Maybe not the Finder, but a 'wait for FMP' problem [WAS: Re: R23's Osaxen Rant]
Maybe not the Finder, but a 'wait for FMP' problem [WAS: Re: R23's Osaxen Rant]
- Subject: Maybe not the Finder, but a 'wait for FMP' problem [WAS: Re: R23's Osaxen Rant]
- From: Paul Berkowitz <email@hidden>
- Date: Sun, 28 Jan 2001 17:36:30 -0800
On 1/26/01 9:05 AM, I wrote:
>
After all that, it tells the Finder to label the first file green, to
>
indicate that there was no trouble with the FMP import. (If there was an
>
error in the FMP step, then the on error segment tells the Finder to label
>
the file red and to send out an alert email message.) And that's where the
>
script fails. It's a little puzzling, since the file copying was done so
>
many stages further back: it can't possibly still be doing that
I've been looking again at this script which couldn't get the Finder to
apply index labels. Something other than what I thought - different from my
previous problems with the Finder - is actually going on. Any copying or
moving of the file in question is long over, wasn't done in the Finder in
any case, and other operations have already happened successfully with the
file. The last previous action on it was to open it for access, read it and
close access. I thought for a time that perhaps the problem might have been
that it was still open, preventing the Finder from applying the label. But
1) it isn't, and 2) the Finder can apply labels indices to files while they
are open for access. I've checked. So it can't be that. Furthermore,
substituting the Akua method for setting the "label number" worked more
frequently than the Finder, but NOT consistently, and it hung the computer
rather than erroring. This is actually worse, since it can't be trapped.
This must be the problem: just before the label indexing, FileMaker Pro has
been asked to do one of its own FileMaker scripts (importing a different
file). I think that the problem must be that while it is running its script,
it somehow prevents other things from happening, at least in the Finder or
Akua's substitute interface. What I really need is to make the script wait
until FMP is finished. How can I do that? I've looked at Bill Cheeseman's
IdleLib to see if I can use part of it, but I can't see how.
My script is a compiled script running from Entourage. Here are the FMP
lines:
tell application "FileMaker Pro"
try
show window dbName -- might error here
on error
-- some things to open the database and try again later
return
end try
tell database dbName
do script (FileMaker script dbScriptName)
end tell
end tell
How can I tell my script to wait until the 'do script' command has
completely finished running before doing anything else? The next command
will be
tell application "Finder" to set label index of txtFile to 6
--
Paul Berkowitz