Home > DeveloperSection > Forums > Using Python, find active window name in Mac OS X
Felix Pickles
Felix Pickles

Total Post:24

Points:168
Posted on    September-30-2015 12:23 AM

 iPhone iPhone  Ios  Objective C 
Ratings:


 1 Reply(s)
 502  View(s)
Rate this:

How can I find the name of the application that window I currently using with the time (MAC OS X using Python)?



Tarun Kumar

Total Post:210

Points:1614
Supported
Posted on    September-30-2015 11:05 PM

From AppKit import NSWorkspace

active_app_name = NSWorkspace.sharedWorkspace().frontmostApplication().localizedName()

print active_app_name

Modified On Sep-30-2015 11:06:49 PM

Don't want to miss updates? Please click the below button!

Follow MindStick