I'm trying to figure out how to create a daemon that will take screenshots every 5 minutes on OSX.

The daemon with launchctl seems to run under a separate session so the screenshots I'm getting right now are just of my blank home screen rather than my actual current session screen.

Currently I have a screencapture script:


screencapture ~/Desktop/$(date +%y%m%d%H%M%S).png

And a plist file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  • So you’re looking to get the OS to let you capture things on the screen like a key logger / spy program. How are you loading this script in to launchd? – bmike Apr 23 at 20:49
  • Pretty much. But just want it to track what I'm spending my time doing. Just using launchctl load -w – Nick O'Brien Apr 23 at 23:23

You must log in to answer this question.

Browse other questions tagged .