Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Identify which app or process is stealing focus on OSX
from AppKit import NSWorkspace
import time
t = range(1,100)
for i in t:
activeAppName = NSWorkspace.sharedWorkspace().activeApplication()['NSApplicationName']
print activeAppName
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment