Chuck Posted May 27, 2001 Posted May 27, 2001 I have an AppleScript snippet that is the following: tell application "StuffIt Deluxe
BobWeaver Posted May 28, 2001 Posted May 28, 2001 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
Chuck Posted May 29, 2001 Author Posted May 29, 2001 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""]
BobWeaver Posted May 29, 2001 Posted May 29, 2001 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"]
Chuck Posted May 30, 2001 Author Posted May 30, 2001 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
BobWeaver Posted May 30, 2001 Posted May 30, 2001 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 ]
Chuck Posted May 30, 2001 Author Posted May 30, 2001 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
Newbies kokez Posted August 15, 2001 Newbies Posted August 15, 2001 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
jfmcel Posted September 23, 2001 Posted September 23, 2001 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.)
homelink Posted September 28, 2001 Posted September 28, 2001 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
homelink Posted September 28, 2001 Posted September 28, 2001 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
Recommended Posts
This topic is 8455 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