Skip to main content

Ever wanted to get some details about the foreground app, such as which is it, which URL is currently opened, etc? This project is for you.

Demo via sleep 3; ./demo.py.

Examples:

$ ./demo.py
{'appName': 'Terminal',
 'idleTime': 0.274327906,
 'url': 'file:///Users/az/Programmierung/foreground_app_info',
 'windowTitle': './demo.py  /Users/az/Programmierung/foreground_app_info \xe2\x80\x94 osascript \xe2\x80\x94 80\xc3\x9724'}

$ sleep 3; ./demo.py
{'appName': 'Chrome',
 'idleTime': 1.440957492,
 'url': 'https://news.ycombinator.com/',
 'windowTitle': 'Hacker News'}

$ sleep 3; ./demo.py
{'appName': 'Finder',
 'idleTime': 2.213467371,
 'url': 'file:///Users/az/Documents/',
 'windowTitle': 'Documents'}

$ sleep 3; ./demo.py
{'appName': 'TextEdit',
 'idleTime': 1.435908488,
 'url': 'file:///Users/az/Documents/todo-musicplayer.txt',
 'windowTitle': 'todo-musicplayer.txt'}

This is currently used by TimeCapture.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

foreground_app_info-1.20150501.162136.tar.gz (4.6 kB view details)

Uploaded Source

File details

Details for the file foreground_app_info-1.20150501.162136.tar.gz.

File metadata

File hashes

Hashes for foreground_app_info-1.20150501.162136.tar.gz
Algorithm Hash digest
SHA256 39277fe7b996a6ba23d34eb28c1a11a73c3cfbd979f4b3a344d00776eb2bc293
MD5 c58fb92b9b03d5b9c69b66e91da41cde
BLAKE2b-256 4db8f2f59555cc0f79929c1ac003c909e911e9bcb8b9b77c9d8629c9c5e806aa

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.20150501.162136 This release

1 file

1.20150501.160214

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page