May 27, 200124 yr I have an AppleScript snippet that is the following: tell application "StuffIt Deluxe
May 28, 200124 yr What happens if you move the "With timeout..." outside of the "Tell" like this: code: With Timeout of 1200 seconds tell application "Stuffit Deluxe" . . . end tell end timeout
May 29, 200124 yr Author Nope, that didn't work. Here's the full script, FileMaker and AppleScript: code: Perform Script [ Sub-scripts, "Script Start"] If [ "MainMenu~gContant#gConstant::gPlatform != "Macintosh""]
May 29, 200124 yr Just a wild guess, but maybe Filemaker sets it's own timeout of 60 seconds no matter what you put in the applescript. How about breaking it into two applescripts, one to do the main part, and the other to quit Stuffit, something like this: code: Perform Applescript[ set clientsFolder to ....etc. . . . Ignoring application responses tell application "Stuffit Deluxe" . . . . end tell end ignoring -- end of applescript ] Pause/resume Script [ 1200 seconds] Perform Applescript [quit application "Stuffit Deluxe"]
May 30, 200124 yr Author Interesting idea, but it wouldn't quite work that way. The nice thing about the timeout is that it won't wait the entire time if it's not necessary. I don't think any of the archives are going to take 20 minutes to create, which is why I used such a high number. Maybe if I can find a way to check the status of StuffIt to see if the archive is done, and if it is, quit the program, that might be a valid workaround. For instance, when the system is stuffing something, there is the dialog visible that displays the process. Perhaps something like this: code: Loop
May 30, 200124 yr I was going to suggest something like that, but I've never tried scripting Stuffit. So, I don't know how you would test it to see when it's finished. You might try: code: tell app "Finder" -- see if stuffit has created the archive If exists ( file "MyStuffitArchive.sit" of folder "MacHD:MyArchiveFolder") then set Stuffit_Is_Done to true else set Stuffit_Is_Done to false end if end tell I've used this code successfully to find out when an application has completed its printing task by checking for the existence of the print file in the desktop printer container (that's why I used the goofy file name syntax in the example). But, I don't know whether the existence of the archive file would indicate that Stuffit is finished. Maybe you can also check to see if the archive file is still open. [ May 30, 2001: Message edited by: BobWeaver ]
May 30, 200124 yr Author Having it check to see if the archive exists wouldn't work, because it exists as soon as it starts stuffing. And checking to see if it is open wouldn't work because it would only close when it's finished, and I can't get my script to get to that part. But I'll do some experimenting and see what happens. I'll post my results here on the forum, in case anyone else ever needs something like this. Chuck
August 15, 200124 yr Newbies Hi list, i had a similar applescript timeout problem if i try to download something with "URL Access Scripting" from a Perform AppleScript script step that take longer than 60-70 seconds. The only workaround that i've found is the same suggested from Bob: "Ignoring application responses tell application "URL Access Scripting" . . . end tell end ignoring" But obviously, this way i can't manage any errors that can occurr. bye
September 23, 200124 yr I think the solution is to use an AppleEvents to launch the script externally. It has been my experience that timeouts are messed up by FM when launched internally. (Sometimes adding a Tell me to ... will help, especially when you have a dialog.)
September 28, 200124 yr FMP can be fussy about AppleScript. The easiest solution is to convert your AppleScript to an application that does your stuffing -- you can make the timeout as wildly long as necessary. The, use FMP to OPEN your AppleScript application. Example in FMP: Tell application "MyCoolStuffitScript" activate end tell
September 28, 200124 yr Oops! I forgot the "test" in my previous post Your AppleScript application will quit when it's done so just get a list of processes and look for your script. Loop through this periodically until your Script is not running using a conditional. set AppsRunning to ((the name of every application process) as string) if AppsRunning does not contain "SomeApplication" then do this stuff
Create an account or sign in to comment