Chuck Posted August 29, 2003 Posted August 29, 2003 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
jfmcel Posted August 30, 2003 Posted August 30, 2003 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
Chuck Posted September 24, 2003 Author Posted September 24, 2003 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()
jfmcel Posted September 25, 2003 Posted September 25, 2003 From the Toast dictionary, disc status should be... status code integer [r/o] -- Toast
Chuck Posted September 25, 2003 Author Posted September 25, 2003 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
jfmcel Posted September 25, 2003 Posted September 25, 2003 Seems like that was the conclusion of a previous thread... http://www.fmforums.com/threads/showflat.php?Cat=&Board=UBB20&Number=17632&Forum=UBB20&Words=timeout&Match=Entire%20Phrase&Searchpage=0&Limit=25&Old=allposts&Main=17632&Search=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.
Recommended Posts
This topic is 8063 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now