|
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
On 2009-09-17, at 21:05:41, Robert Poland wrote:<key>Program</key><string>/Library/Scripts/Universal\ Scripts/playMantelSound</string><key>ProgramArguments</key><array><string>/Library/Scripts/Universal\ Scripts/playMantelSound</string></array>What's playMantelSound (shell script? AppleScript?) and why does it pass a parameter of itself to itself?He's created his plist with some utility. It's looks like it's trying to follow the guidelines but doesn't have it quite right. The parameters are the same as those for <x-man-page://3/execvp> as transcribed for the launchd property list XML format. So the Program should contain the full path to the tool, but the first ProgramArgument should contain only the name of the tool.It does seem kind of odd not to see a .scpt or .scptd extension, but that's a user preference. However if he's just hiding the extension rather than omitting it entirely, then that will be a problem as well (and possibly the cause of the error he reported previously). I think you haven't followed the documentation or grokked the nature of launchd agents because the example above is still horribly wrong. Firstly, launchd is looking for an _executable_ not a script, so you have to use an executable like osascript to run the script. Secondly, the "Program" and "ProgramArguments" are an XML representation of <x-man-page://3/execvp> and mostly likely written so that they can be loaded into a format suitable for an NSTask-like invocation with a minimum amount of effort. Everyone has to follow that format for this kind of agent. And thirdly, in this case, you only need the StartCalendarInterval for the key/value pair. The following (save it as "ca.aker.playsound.plist" and remember to 'chown root:wheel'), is something that works OMM. At first, only change "some.scpt" into "playMantelSound.scpt" to check if it works on your setup (I'm on 10.6.1 BTW). <?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>ca.aker.playsound</string> <key>Program</key> <string>/bin/sh</string> <key>ProgramArguments</key> <array> <string>sh</string> <string>-c</string> <string>/usr/bin/osascript /Library/Scripts/Universal\ Scripts/some.scpt</string> </array> <key>StartCalendarInterval</key> <dict> <key>Minute</key> <integer>0</integer> </dict> </dict> </plist> Since I don't have playMantelSound.scpt, I can only assume that it actually works in Script Editor. The "some.scpt" I used looks like: say "bob" delay 2 Philip Aker echo email@hidden@nl | tr a-z@. p-za-o.@ Democracy: Two wolves and a sheep voting on lunch. |
_______________________________________________ Do not post admin requests to the list. They will be ignored. AppleScript-Users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: Archives: http://lists.apple.com/archives/applescript-users This email sent to email@hidden
| References: | |
| >cron/Launchd Editor (From: Robert Poland <email@hidden>) | |
| >Re: cron/Launchd Editor (From: Philip Aker <email@hidden>) | |
| >Re: cron/Launchd Editor (From: Robert Poland <email@hidden>) | |
| >Re: cron/Launchd Editor (From: Philip Aker <email@hidden>) | |
| >Re: cron/Launchd Editor (From: Robert Poland <email@hidden>) | |
| >Re: cron/Launchd Editor (From: Tom Robinson <email@hidden>) | |
| >Re: cron/Launchd Editor (From: Philip Aker <email@hidden>) | |
| >Re: cron/Launchd Editor (From: Robert Poland <email@hidden>) |
| Home | Archives | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2011 Apple Inc. All rights reserved.