Skip to main content

Get details about the application and opened URL which is in foreground

Project description

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; ./


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

$ sleep 3; ./
{'appName': 'Chrome',
 'idleTime': 1.440957492,
 'url': '',
 'windowTitle': 'Hacker News'}

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

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

This project is registered on Pypi. You can install it via:

$ pip install foreground_app_info

Simple demo code:

from foreground_app_info import get_app_info
from pprint import pprint


This is currently used by TimeCapture.

Project details

Download files

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

Files for foreground_app_info, version 1.20150502.141250
Filename, size File type Python version Upload date Hashes
Filename, size foreground_app_info-1.20150502.141250.tar.gz (5.6 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page