getting a script to automatically run

Any suggestions on how to get a script to automatically run. It sits on my desktop now. I can get it to open with ical, but have to hit run manually.

hi wmm,

i personally like to use cron combined with osascript to do this. a lot of people are talking up ‘launchd’, if you are on 10.4.X, but unfortunately i haven’t messed w/ it yet.

cheers.

Can you be more specific…do you want your script to run at a certain time every day, or in response to a certain application running, or some other “event”?

(EDIT: Just saw Waltr’s post…I too use cron for “run this script at the same time every day” kind of tasks, specifically by using the CronniX application, which makes cron a bit more user-friendly for me.)

It sounds like your saving the script wrongly.

I’m trying to run the script at the same time every day. I have one script that ical seems to open and run. But ical will only open this one, then I have to actually hit the run key. I’ll click on your link for cron. Right now we are running 10.2.8
wmm

Hi wmm,

When you save as application, you need to check never show startup screen, then it automatically runs.

But it’s better to save as Compiled Script and the script doesn’t act like an application. If you save as Compiled Script, then you must think about what application is running the script. If you use iCal, the iCal helper has no front end. So if you use a command like ‘display dialog’ it needs a visible process and you need to use some app to display the window. For instance, the Finder, System Events, or the frontmost process.

tell app “Finder”
display dialog “hello”
end tell

This will work when run from an iCal event, because it now runs through the Finder.

gl,

Hi Kel,
That mostly makes sense to me. I’m going to have to play with that. You’ve probably explained why one of my scripts will run automatically in ical. I have 10.4 tiger sitting here to load, but I haven’t had time to back everything up. I’m assuming automator will do this too.
thanks,
wmm