Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 8455 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I have an AppleScript snippet that is the following:

tell application "StuffIt Deluxe

Posted

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


Posted

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""]

Posted

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"]


Posted

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

Posted

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 ]

Posted

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

  • 2 months later...
  • Newbies
Posted

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

  • 1 month later...
Posted

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.)

Posted

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

Posted

Oops! I forgot the "test" in my previous post frown.gif" border="0

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.