Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --script by Applehelpwriter 2013 / www.applehelpwriter.com
- (*
- this little script will keep track of which app is in use and for how long
- it deposits and updates a .txt file on your desktop
- you can open the file and watch it in real time or just use it to collect data for later
- note the script is an endless loop; it won't quit till you quit it manually
- to use it, paste into AS editor and hit 'run'; hit 'stop' when you've had enough
- else set it up in launch agents or cron jobs
- *)
- set front_app to (path to frontmost application as text)
- set _start to current date
- repeat
- delay 5
- set current_app to (path to frontmost application as text)
- if current_app is not equal to front_app then
- set _stop to current date
- do shell script "echo " & front_app & " was active from " & _start & " until " & _stop & " >> ~/Desktop/log.txt"
- set front_app to current_app
- set _start to current date
- end if
- end repeat
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement