Possible?: Daily Scheduled "open file"

I need to open a couple of Filemaker files daily, at two different times. iCal Alarms aren’t working. Cron (Cronnix) isn’t working.

Is there an Applescript way to do this?

Steve.

AppleScript certainly can do this (the actual opening)… (well i suppose the checking too), but the prefered method would be to use iCal events or cron/launchd jobs to run applescripts that then do what you wish.

So Im curious what exactly is not working with iCal/Cron and how hve you tried to implement your solution?

I tried to set Alarms with “open file” triggers in iCal, but it didn’t do anything.

I tried to set cron jobs using Cronnix, but I was only able to get one to trigger once. Not sure why they don’t work, but can’t do much research on it because I can’t get into the cron directories using Terminal because it says I’m not authorized (despite using sudo and it’s my machine).

I’m tryng to find something that works, rather than do more troubleshooting on things that aren’t working.

BTW, I’m doing this from a non-admin account, but the files start manually just fine.

Steve

Well I just tested it with iCal events and they seem to work, here is the script I used

tell application "FileMaker Pro"
	open file "Path:to:some:File.fp7"
end tell

Steve:

I think you should at least consider launchd, especially if you are running an Intel Mac. The launchd system does indeed work on PowerPC chips, but is not reliable for daily launches at specific times. The learning curve is not nearly as steep as some people claim. Here is an article I wrote last year that can help you get started, or just email me or post back here with further questions if you want to pursue it.

(There is only one bad link in the article, the rest still point to the correct sites.)

Good luck,

Thanks guys.

Unfortunately (wrt launchd), it’s a G5, and

iCal doesn’t seem to trigger anything, so I don’t know if it will start behaving by triggering an AppleScript.

I’ll check them out anyway.

Steve.

I guess the question remains as to whether AppleScript alone can handle this.

It would need to be able to open one of two files two times per day.

Does AppleScript have the ability to fire off actions based on time of day?

Steve.

Use CronniX (cron) to fire-off an AppleScript.

Save the AppleScript as an application for the most stability. I do alot of overnight automations this way. If you can’t get that combo to work, I suspect something a little fishy and maybe you can give me/us more details. I found running raw scripts (rather than scripts-saved-as-apps) less reliable, for reasons I never bothered to track down thoroughly (though it often revolved around permissions).

I’ve even tried making cron (via CronniX) do things mid-day and it will happily interrupt or set-off background tasks while I’m working, so that shouldn’t be an issue.

I’m too lazy to use cron directly, never bothered with launchd since CronniX makes using cron relatively easy (“if it ain’t broke…”). I admit I prefer a pretty GUI over doing direct command-line, despite years (or maybe because of?) of using line-BASIC, CP/M, and Linux. :wink:

Steve:

The only way that AppleScript has the ability to fire off something at specific times of the day is to use a Stay Open application. Essentially, it is a script that simply repeats over and over (at whatever interval you choose) running all the time until the user quits it. For instance, I use one on an old G3 laptop as an alarm clock for my kids (using iTunes). The computer turns itself on every Sunday night, the application launches, and it sets the interval between the current time and the designated alarm time. It uses that interval as the repeat, then when it does repeat, if the time is correct, it tells iTunes to play a randomly selected set of tracks. It then resets the interval for 23.75 hours or so, and starts all over again. On Fridays, the computer shuts down. It is certainly not a fancy system, but since we don’t use the machine for anything else, it is cool for the kids.

As long as you can tolerate a continually running application (the icon will be in the dock), that could work for you as well.

Craig,

A stay open script would be fine for this single-purpose machine. Thanks for the description. I’ll try to figure it out.

==============
Calvin,

Cron doesn’t seem to be cronning on this machine.

Steve.

Steve:

It is not much, but here is a short script that may help you get started.

Thanks Craig,

I grabbed a copy. Hopefully, I’ll have some time to work on that today.

Steve.