Jump to content

  •  

Photo

Timing Out Even with in "with timeout"


  • Please log in to reply
5 replies to this topic

#1 Chuck  Veteran

Chuck
  • Members
  • 976 posts
  • LocationMenifee, CA
  • FM Application:12 Advance
  • Platform:Cross Platform
  • Skill Level:Expert
  • Certification:7, 8, 9, 10, 11
  • Membership:TechNet
  • Time Online: 10h 47m 56s

Posted 29 August 2003 - 02:32 PM

I have an AppleScript that includes the following code:

tell application "Toast Titanium"
activate
make new Data disc
open alias (CDS_TO_BURN_FOLDER & CURRENT_CD_NUMBER)

with timeout of 30000 seconds
write current disc without asking
end timeout
end tell

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.

Thanks,
Chuck
  • 0

#2 jfmcel  master

jfmcel
  • Members
  • 310 posts
  • FM Application:7
  • :

Posted 29 August 2003 - 07:01 PM

With the introduction of Toast 5.x, I've encountered the same problem. This was my work around...

tell application "Toast Titanium 5.0.2"
ignoring application responses
write current disc as session
end ignoring
repeat
with timeout of 3600 seconds
set theStat to status code of current disc
end timeout
if theStat is 0 then exit repeat
if theStat < 0 then
-- do some toast error routine
exit repeat
end if
delay 4
end repeat
end tell
  • 0

#3 Chuck  Veteran

Chuck
  • Members
  • 976 posts
  • LocationMenifee, CA
  • FM Application:12 Advance
  • Platform:Cross Platform
  • Skill Level:Expert
  • Certification:7, 8, 9, 10, 11
  • Membership:TechNet
  • Time Online: 10h 47m 56s

Posted 24 September 2003 - 01:05 AM

Well, I tried your technique but unfortunately had no success.

Here's the entire handler that I'm trying to use to write these CDs from within FileMaker:

to BurnCDs()


  • 0

#4 jfmcel  master

jfmcel
  • Members
  • 310 posts
  • FM Application:7
  • :

Posted 24 September 2003 - 08:49 PM

From the Toast dictionary, disc status should be...

status code integer [r/o] -- Toast
  • 0

#5 Chuck  Veteran

Chuck
  • Members
  • 976 posts
  • LocationMenifee, CA
  • FM Application:12 Advance
  • Platform:Cross Platform
  • Skill Level:Expert
  • Certification:7, 8, 9, 10, 11
  • Membership:TechNet
  • Time Online: 10h 47m 56s

Posted 24 September 2003 - 10:03 PM

Thanks for the info, but neither going to an earlier version nor going to OS 9 are an option. I did get it to work with a kludge, and in fact, the nature of the kludge seems to indicate that the problem lies with FileMaker, not with Toast.

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.

Chuck
  • 0

#6 jfmcel  master

jfmcel
  • Members
  • 310 posts
  • FM Application:7
  • :

Posted 25 September 2003 - 10:37 AM

Seems like that was the conclusion of a previous thread...

http://www.fmforums....=true#Post17632

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.
  • 0




FMForum Advertisers