Skip to content

Instantly share code, notes, and snippets.

@reacuna
Forked from iMerica/identify_focus_issue.py
Created August 8, 2018 20:03
Show Gist options
  • Save reacuna/19df031db946dfa71b8ceb36eb0beedf to your computer and use it in GitHub Desktop.
Save reacuna/19df031db946dfa71b8ceb36eb0beedf to your computer and use it in GitHub Desktop.
Identify which app or process is stealing focus on OSX
#!/usr/bin/python
from AppKit import NSWorkspace
import time
t = range(1,100)
for i in t:
time.sleep(3)
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