Running AppleScripts with CRON...gotchas?

[apologies for the flood of questions…my boss has been giving me time for these projects and I only just found this resource…I have alot of pent-up questions…]

This one has been bugging me for ages:

I write an AppleScript. It works fine as a script from Script Editor. It works fine as an Application from Script Editor. Use Cronnix to set it for automation overnight. Use “Run now” from Cronnix, works fine. But when CRON fires-off the task overnight? Errors of one sort or another.

I used to use iDo Scheduler, but instead of errors, it simply stopped working for no apparent reason.

I could post the problems one by one for solution (and might if I get desparate), but I thought maybe I’d start by asking what differences between a Finder-level execution of an AppleScript and a CRON execution of an AppleScript might exist.

Most of the errors are of the “no user interaction allowed” variety, though my latest script is giving me something about not being able to make a variable “real”.

How are you running these scripts with cron? Via osascript?

I was given a utility called CronniX, which I was told is simply a GUI for making CRON entries.

You give it specific/wildcard time/date/day information, repeat information, and tell it where the “whatever you want to run” is. Looks like any executable…applications. In my case, AppleScripts. Seems to run either raw scripts or scripts saved as Applications, though I found I get less errors if I make my scripts applications.

in terminal:

try sudo chmod 777 /path/to/applescript

then enter your password

that will make the file executable.

I run applescripts via cron successfully.

-Ralph

why cronix? just open terminal and run cron.

type ‘man cron’ for instructions

-ralph

CronniX provides a nice GUI, quick and easy to see what is going on with the 8 scripts I’m up to, easy to edit quickly.

Still works under Leopard too, though running through Rosetta. I’m still waiting for a CronniX-like launchd utility, but haven’t seen one yet. I still find launchd more annoying to use than CronniX. I guess once cron is dropped altogether or CronniX breaks I’ll be forced to switch, ease-of-use be damned. :wink:

Do folks think they’re really going to drop cron? I would hope they would continue to support it…