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[1]: (com.highintegritydesign.wirelessgenie[25674]) Service could not initialize: 14F27: xpcproxy + 13421 [1402][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">
  • Since you're putting the user/password in the .plist, have you tried coding it into the script to see if launched handles it any different? Also just as a test I'd schedule it using cron to see how it handles it. BTW you should include the version of OS X you're using in your post. Maybe even the the AppleScript too. – user3439894 Oct 12 '15 at 0:03
  • I'm on OS X 10.10.5, the Script Editor says its version is 2.7, and it's generating AppleScript 2.4. Yes, I've tried coding the same username/password into the script and it works fine. I have not tried cron. If that works it would definitely point the finger at the plist. But, that won't help be diagnose what's wrong with the plist. – North Krimsly Oct 13 '15 at 4:18
  • So if you coded the user/password into the script and launchd was able to start it okay, then what the issue? Why can't you leave it that way instead of passing the user/password to the script? It if does work with the user/password embedded in the script with launchd but not passed to it via launchd then the issue appear that you can't pass it via launchd and leaving it embedded is the way to go. BTW when I said "Maybe even the the AppleScript too", I meant the actual AppleScript not its version number. – user3439894 Oct 13 '15 at 12:36
  • Ahh, I see what you mean. I mis-understood. The script worked when I coded the user name and password into it, but ran it manually. I have yet to get it to work when executed through Launchd. – North Krimsly Oct 13 '15 at 14:40
  • The script is up on Github at github.com/northk/wireless-genie. – North Krimsly Oct 13 '15 at 14:44

You must log in to answer this question.

Browse other questions tagged .