I am having troubles making a Launchd script. It is fairly simple, all it needs to do is launch an application - the location is: /Library/Desktop Pictures/wallpaper
I've loaded the file using terminal, and terminal gives no errors but the script does not execute. I need the script to execute every 1 hour.
The 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">
<dict>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>wallpaper.restart</string>
<key>ProgramArguments</key>
<array>
<string>/Library/Desktop Pictures/wallpaper.wallpaperapp.app</string>
</array>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>1</integer>
</dict>
</dict>
</plist>
Please Help.
Thanks, Devansh
EDIT:
Below is the next better version of the above code, but still not much luck :(
<?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">
<dict>
<key>KeepAlive</key>
<dict>
<key>AfterInitialDemand</key>
<true/>
</dict>
<key>Label</key>
<string>com.plisterine.backgroundchanger</string>
<key>LowPriorityIO</key>
<false/>
<key>Nice</key>
<integer>0</integer>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/osascript</string>
<string>/Library/Desktop Pictures/wallpaper/wallpaper.scpt</string>
</array>
<key>StartInterval</key>
<integer>3600</integer>
</dict>
</plist>
<string>/Library/Desktop Pictures/wallpaper.wallpaperapp.app</string>
Are you certain it is correct?wallpaper.wallpaperapp.app
in that directory, it would probably be an application bundle, not a binary executable. It's also unlikely that it would work correctly when run from launchd, outside a desktop session.