Idle handling questions
Idle handling questions
- Subject: Idle handling questions
- From: "Connor W. Anderson" <email@hidden>
- Date: Wed, 14 Nov 2001 15:39:28 -0600
I am trying to set up a script to do a number of tasks related to importing
and purging data from our FileMaker Pro databases each night. Because this
is a very old application, one of the things that must be done each day is
to open the databases and allow them to recalculate today. (Don9t ask, we're
going to fix it when we upgrade to FMP 5.5 in January)
As all this is still running on some older hardware (8500/200) this can take
a few minutes. I've tried to put together a decent idle handler for this to
prevent the AppleEvents from timing out. But I still get the error. Not
sure what I'm doing wrong here. BTW, we are running on OS 9.1 here.
I'm not exactly a newbie, but this is my first time dealing with handlers
and subscripts. Anyway, here is a sample of the questionable bits. When
this script is run as a cron job (the old Classic Cron implementation, great
stuff!) it generates an AppleEven timeout error either in the recalcToday
script or in the openAdTrackerDBs script which has a very similar idle
handling routine.
Is this the way to go about it? What am I missing?
--top of script
global DatabaseList
--sets DatabaseList.
tell application "FileMaker Pro Server"
list databases
set DatabaseList to result
end tell
--BEGIN IMPORT SCRIPT ORDER
(*here is where all the script steps run in order according to the error and
idle
handlers contained within each sub-script.*)
run mountScript --mounts remote volumes, easy
run disconnectDBs --closes all databases in FMP server, easy.
run recalcToday -- see below
run openAdTrackerDBs
--recalculate today function. Not be needed in FM 5.5 versions.
script recalcToday
on idle
tell application "FileMaker Pro"
if DatabaseList does not contain database 1 then --when there
are no
--more active databases, e.g. all have opened and closed,
quit.
quit me
end if
end tell
return 150
end idle
on run
tell application "FileMaker Pro"
repeat with vDatabase in DatabaseList
open vDatabase
try
close database 1
end try
--error trap
end repeat
end tell
end run
end script
--
Connor W. Anderson
Technical Services Manager
Woodward Communications, Inc.
"Saying Windows is the best operating system in the world because more
people use it is like saying McDonald's makes the best food in the world."
-Anon.