Timing Out Even with in "with timeout"
Posted 29 August 2003 - 02:32 PM
tell application "Toast Titanium"
make new Data disc
open alias (CDS_TO_BURN_FOLDER & CURRENT_CD_NUMBER)
with timeout of 30000 seconds
write current disc without asking
This code is of course part of a much larger program, but this is were my error is occuring.
When I run this code from within Script Debugger, it works find. The AppleScript waits until Toast is finished burning the disc before continuing. However, when I run the exact same program from within FileMaker, I get the following error from the FileMaker application:
"Toast Titanium got an error: AppleEvent timed out. (Error -1712)."
So, any ideas? How can I get FileMaker to actually wait like the code says to do? According to FileMaker's Knowledge Base article 102246, FileMaker should recognize the "with timeout" construct. Of course the article was originally written in the 2.x days, although it seems to be valid for at least version 5, and I'm using version 6.
I'm interested in the reason this isn't working as well as a fix if possible. The workaround that I've come up with is to enter a loop that tests whether Toast is responding somehow (now sure how I'll do this part yet) and only continue the script when Toast responds successfully.
Posted 29 August 2003 - 07:01 PM
tell application "Toast Titanium 5.0.2"
ignoring application responses
write current disc as session
with timeout of 3600 seconds
set theStat to status code of current disc
if theStat is 0 then exit repeat
if theStat < 0 then
-- do some toast error routine
Posted 24 September 2003 - 01:05 AM
Here's the entire handler that I'm trying to use to write these CDs from within FileMaker:
Posted 24 September 2003 - 08:49 PM
status code integer [r/o] -- Toast
Posted 24 September 2003 - 10:03 PM
Basically, I saved the script as an applet, and I use the Send Apple Event script step in FileMaker to run the applet. This works. Like I originally said, the only place the script doesn't work is when it is run as an embedded script within FileMaker. I've run it successfully in Script Debugger, Smile and Script Editor, and now as an independent applet. Everything but FileMaker correctly waits for the time indicated within the "with timeout" block.
Thanks for the input. Hope my adventures help someone else in the future.
Posted 25 September 2003 - 10:37 AM
It is a strange problem because it seems I've had plenty of instances where the timeout block does work in AppleScripts run within FM (e.g. burning discs with Toast 4.x). It is also annoying that the fix I found for Toast 5.0.2 does not work with newer versions of Toast.
It would be nice if FMI would fix whatever problem they have with their AS complier (this timeout problem has persisted over several versions). The FM applescript dictionary hasn't been expanded since version 3. AppleScript can give you amazing versility in both setting FM data and controlling other applications. There is a sizable community of FM developers that use applescript -- and I participate in the forum to help make that community larger. A little bit of effort from FMI to improve FM AS functionality would be nice.