Re: Crontab doesn't work for me
Re: Crontab doesn't work for me
- Subject: Re: Crontab doesn't work for me
- From: Brian Johnson <email@hidden>
- Date: Tue, 21 Sep 2004 16:15:10 -0700 (PDT)
On Tue, 21 Sep 2004, Dan Doughtie wrote:
Using the example from Ethan Wilde?s book on AppleScript For Applications I
created a cron job that is supposed to run a compiled Applescript that
basically tells an app to activate. (page 68)
Welcome to the "you can't run Applescripts in a shell universe" problem.
Shell scripts that use osascript will die a horrible death if they aren't
run from a window'ed environment (under the control of "Window Server").
If you check your system log I think you'll find your script crashing each
time cron launches it.
The "open -a" suggestion might work for Entourage, but it won't run the
script (I don't think) for much the same reason.
I bumped into this myself a while back (you can't use php EXEC commands to
run applescripts either -- same reason, and this is part of why apache
won't run applescripts without help) and eventually put together a partial
solution (not guaranteed for all situations....) It's called 'peacePipe'
(look online at quicksilver.caup.washington.edu/software) and it creates a
tunnel between the shell universe and a logged-in user universe using
sockets (and blah blah). The upshot of it is that you can run a shell
script in cron that talks through the pipe to your applescript
applications (and potentially gets results back). Unfortunately, I
haven't gotten around to documenting how you do this easily, so write
to me privately if you decide you need to do this and someone else
doesn't suggest a better way.
Brian Johnson, Dept of Architecture, University of Washington, Seattle
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden