Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'great idea, but hey, use cron!' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
great idea, but hey, use cron!
Authored by: wealthychef on May 13, '02 08:33:40PM

From everything I can tell, you cannot run applescripts from cron. So the only thing to do, would be to compile the arguments to osascript into little applications with AppleScript Editor, and call them from your script using \'open.\' For example, instead of the line:
echo \"tell application \\\"$music_app\\\" to play (some track of playlist \\\"Library\\\" whose artist is \\\"$artist\\\")\" | /usr/bin/osascript

You would put the line:

tell application \"iTunes\" to play (some track of playlist \"Library\" whose artist is \"The Rolling Stones\")

into a text file and use Applescript Editor to compile it into an application, say /Users/mylogin/StartPlayingStones

Then the line above becomes:
open /Users/mylogin/StartPlayingStones

and life is good again.
I didn\'t fully test this in the alarm clock context, but was able to confirm that cron can handle a shell script with that \'open\' command in it just fine.



[ Reply to This | # ]
great idea, but hey, use cron!
Authored by: wealthychef on May 13, '02 08:54:34PM
For more info on the cron thing, see: This thread at bbs.applescript.net

[ Reply to This | # ]