Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7291 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hi All, I searched the forum for an answer but was not successful ( found a bad link to a plug-in). I would like to run a filemaker script early each morning to take care of some housekeeping chores. How can I set up a script to run at say 3:00am each morning??

Any assistance will be appreciated.

Posted

I use windows, so I don't know exactly how this converts to a Mac. But basically I create a FM "trigger" file that has 1 script. This script launches all of the scripts in other files I want to run at time X. The last step of the script is the close file command so that the trigger file closes itself. The file is set to launch this script on open. All of this should be the same on the mac. Then on windows I use the scheduler to open the trigger file at, say, 3:00 each day. All you need is the Mac equivalent of the scheduler (I'm pretty sure there is one) and you're all set.

Hope this windows example helps...

Dan

Posted

Hi Dan, thanks for your thoughts, I am not aware of a Mac scheduler I could use that would automatically start this task. If anyone out there is, I would appreciate your input..... Thanks!

Posted

There is a schedular built-in to the Unix system, crontab. But it's command line. There is a free GUI app to edit it, CronniX:

http://www.versiontracker.com/dyn/moreinfo/macosx/9478

I also found a little Cocoa app, which is about the simplest thing I've ever seen. It can run an AppleScript script.

http://gr0mit.free.fr/soft/chrono-pouet.html

It's so simple that it has to kept running to work, using 29MB (!?), and has (very) few options. It would make a good little timer though.

Whereas CronniX is an editor of the crontab(s). Once they're set CronniX can be quit and the system will activate your AppleScript applet or shell script. It has some good options, such as which days of the week, etc..

Personally I'd go with CronniX and an AppleScript applet, whose contents would look like:

tell application "FileMaker Developer"

activate

open file "complete filepath to your database file"

do script FileMaker script "Your script name"

end tell

You'd need to keep the computer from sleeping I believe, unless you know how to make it wake up, which I don't; and apparently Apple doesn't either, 'cause the built-in Unix maintenance scripts don't run if your computer's asleep at night.

By the way, those run at around 3:00 am by default. So schedule your script for later.

Posted

Fenton, I downloaded CronniX_2.1i.dmg.gz and needed the gzip program to unzip it. I found the gzip program but the latest version wants to run under Classic OS9. when I tried to unzip the CronniX file gzip hung up. Is there an OSX version of gzip out in cyberspace somewhere?? Thanks,

===========================

Posted

Try this, using iCal create a daily task set for 3:00 am every day or every weekday. In the "Info Bar" Under Alarm click on the menu option, it probably says "Message" now, look for "Open File", the default file is iCal but if you click on iCal you'll get an option for "other" which will allow you to chose any file to open at the assigned time or a set number of minutes before or after.

Let me know how it works. Seems pretty simple.

Phil

Posted

CronniX works great. Here's a working link:

http://www.koch-schmidt.de/cronnix/CronniX_2.1i.dmg

What's nice about it is that you're only using it to change settings for a process that OS X is already running, so the system overhead is as low as can be.

I would Dan's trigger/opener file method, although AppleScript would work just as well.

As for the sleep issue, you can use the Energy Saver in System Preferences, click Schedule/Start Up the Computer, and set a time a few minutes before your cron job.

  • 2 weeks later...
Posted

Fenton and All, just wanted to let you know that your much appreciated efforts to enlighten me have not gone for naught. I have solved the problem of unzipping and opening the .gz file. Stuffit works fine in expanding the file. The problem I had occured when I double clicked the unzipped file and OSX used "TextEdit" to open the file. When I opened it with "Disk Utility" it opened fine.

I am still putting out a few fires and will return to creating the Apple Script file when I have completed these tasks. I will report back with the results. Again, thanks to all who offered assistance here..........

  • 2 weeks later...
Posted

Good Morning Fenton, sorry for the delay in getting back, the brush fire I was tending to turned into a full blown Santa Ana! Thanks for the RCDfaultApp, looks like it will come in handy down the pike.

I now have time to devote to checking out your suggestion about using Cronix to start my early morning housekeeping chores. Will let you know the results within the next couple of days........... Ray

  • 2 weeks later...
Posted

Back again, I have created a Applescript that runs the Filemaker housekeeping script successfully thanks to Fenton's further assistance. I am now going to integrate it with the Cronix program and hopefully will shortly have my housekeeping routine running automatically at 4:00am in the morning.........

================================== smile.gif

Posted

Hi Fenton and All, we'll after discovering that I had named a hard drive with a blank preceeding the name, which caused the AppleScript not to execute since the directory name I defined did not include the blank, I am now at the point of setting up CronniX to execute my little AppleScript which in turn will take care of my early morning housekeeping chores.

CronniX requires that a Unix command execute the AppleScript. I am not familiar with Unix commands, what do I use to execute this AppleScript?? Thanks for your continued assistance in this endeavor......... Ray

  • 3 months later...
Posted

Hi there,

I found this thread when trying to create an automated export script. Thanks to you guys I found CronniX, (which is a great little program, Apple should include something like it with Tiger), and created a crontab entry and AppleScript which in turn calls a FM script.

The problem is that it's not working, and I can't figure out why. The AppleScript works fine when I run it from Script Editor. The osascript command that I run from cron works fine when I type it in the terminal.

I think the problem is how everything is all setup and served. I'm using FM Pro 7 installed onto 10.3. I'm running FM in a separate account called filemaker that's always logged in, and using Fast User Switching to be able to log in and out of other accounts as well.

When I run osascript from the filemaker account (logged in via the GUI) everything works; but when I'm logged into a different account and su as filemaker and then run osascript FileMaker tries to launch in the current account and I get an error because the file is already in use.

The thing is, I'm not sure what happens when cron executes osascript. I would have thought that since I edited the crontab for filemaker (the user) that it would talk to the instance of FM that's already running in the filemaker account.

I know the setup here isn't ideal, but this computer gets used for other things occasionally and I like using FUS so that people can't mess with FileMaker. I've tried convincing them to go for FM Server, but it's too expensive.

This topic is 7291 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.