Re: SOS: AppleScript in FMP5 times out!!!
Re: SOS: AppleScript in FMP5 times out!!!
- Subject: Re: SOS: AppleScript in FMP5 times out!!!
- From: Giorgio Valoti <email@hidden>
- Date: Mon, 05 Mar 2001 21:26:35 +0100
- Organization: MMNet
David Dahl wrote:
>
I always have the same problems with applescript...
>
>
try:
>
with timeout of 3000 seconds
>
tell application "Finder"
>
activate -- this seems to work better for me... whenever you switch
>
apps make it --the front application
>
set new_Folder to duplicate folder the_Folder to folder dest_folder
>
set name of new_Folder to new_Name
>
end tell
>
end timeout
If I understand it well, the problem is to trap the FileMaker timeout as well,
not only the AS timeout. AFAIK, you have two choices:
1- Save your AS as a compiled script and create a FM script to send an Apple
Event ['aevt' 'oapp']
2- Before the AS step in your FM script, put a 'Set error capture ON' statement
However, this could lead to problems if your FM script depends on the results
of the AS side , say it imports a file created by AS. Why? Well, in the first
case FM doesn't wait for the script completion at all: after sending the Apple
Event it goes on with the next instruction. In the second, FM patiently wait a
minute and then goes on... Worse, even if you haven't the timeout problem, FMP
has no way to determine if something gone wrong with the AS script. If you have
a situation like, this I suggest to split your FM script; the first part
executes whatever you want and, as the last step launches the AS script which,
on turn launches the second FM script after its execution.
Excuse me for my bad english, but I hope this helps you anyway.
bye
>
>
[Snip from original message]
>
Hanaan Rosenthal on Sunday, March 4, 2001 at -0600 said:
>
>
>Hello all,
>
>
>
>I am dealing with a very frustrating situation, where a simple
>
>duplicate command in the Finder that can take longer then 60 seconds,
>
>works fine from Script Editor, but not from inside a FileMaker Pro 5
>
>script.
>
>When run from FMP5, it ignores the 'with timeout' part and times out
>
>after a minute.
>
>
--
Giorgio Valoti
Magnetic Media Network <
http://www.magneticmedia.com>
-----------------