Application monitor

Jun 17th, 2013
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --script by Applehelpwriter 2013 /
  2. (*
  3. this little script will keep track of which app is in use and for how long
  4. it deposits and updates a .txt file on your desktop
  5. you can open the file and watch it in real time or just use it to collect data for later
  7. note the script is an endless loop; it won't quit till you quit it manually
  9. to use it, paste into AS editor and hit 'run'; hit 'stop' when you've had enough
  10. else set it up in launch agents or cron jobs
  11. *)
  13. set front_app to (path to frontmost application as text)
  14. set _start to current date
  16. repeat
  17.     delay 5
  18.     set current_app to (path to frontmost application as text)
  19.     if current_app is not equal to front_app then
  20.         set _stop to current date
  21.         do shell script "echo " & front_app & " was active from " & _start & " until " & _stop & " >> ~/Desktop/log.txt"
  22.         set front_app to current_app
  23.         set _start to current date
  24.     end if
  25. end repeat
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add to your ad blocker whitelist or disable your adblocking software.