I've written an AppleScript that turns our CenturyLink modem's wireless radio on or off. It works when I run it manually with osascript, but now I'm trying to get it set up on a schedule with Launchd. I keep getting the following error in the Console log:
10/11/15 3:10:03.178 PM com.apple.xpc.launchd: (com.highintegritydesign.wirelessgenie) Service could not initialize: 14F27: xpcproxy + 13421 [AD0301C4-D364-31CE-8BA7-B5DBECE64D0A]: 0xd
The script is called wireless-genie.scpt and it's in my home directory, with permissions 755 and owned by me. I can successfully launch it manually from my home folder with:
osascript wireless-genie.scpt mywirelessmodemadminuser mywirelessmodempassword
The plist is called com.highintegritydesign.wirelessgenie.plist, shown below. I've placed that into /Library/LaunchDaemons, and it also has permissions 755, and is owned by root.
I've run 'plutil -lint' on com.highintegritydesign.wirelessgenie.plist and it says the plist is A-OK. I loaded the plist with 'launchctl load com.highintegritydesign.wirelessgenie.plist'.
I'm stumped why the script won't execute. Any ideas? Thanks.
<?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>Label</key> <string>com.highintegritydesign.wirelessgenie</string> <key>ProgramArguments</key> <array> <string>osascript</string> <string>/Users/north/Documents/sites/wireless-genie/wireless-genie.scpt</string> <string>mywirelessmodemadminuser</string> <string>mywirelessmodempassword</string> </array> <key>StartCalendarInterval</key> <dict> <key>Minute</key> <integer>10</integer> <key>Hour</key> <integer>15</integer> </dict> <key>StandardErrorPath</key> <string>/var/log/wirelessgenie.log</string> </dict> </plist>