Re: Quitting an applet?
Re: Quitting an applet?
- Subject: Re: Quitting an applet?
- From: "Marc K. Myers" <email@hidden>
- Date: Thu, 30 Nov 2000 03:28:44 -0500
- Organization: [very little]
Rob Jorgensen wrote:
>
Date: Wed, 29 Nov 2000 21:30:59 -0500
>
To: Carl West <email@hidden>, AppleScriptList
>
<email@hidden>
>
From: Rob Jorgensen <email@hidden>
>
Subject: Re: Quitting an applet?
>
>
On 11/29/2000, Carl West commented on "Quitting an applet?":
>
>
>I want my script to quit if the user presses a particular button. It's
>
>not happening.
>
>
Sorry, I can't offer any suggestions because I'm having a similar
>
problem with the following script (droplet):
>
>
For the record, /r = continuation character
>
>
-------------------------------------------
>
>
on open fileList
>
>
set itemCount to count items in fileList
>
>
tell application "Finder"
>
open file "Screenshots.sit" of disk "Win 95"
>
end tell
>
>
tell application "StuffIt Deluxe"
>
repeat with i from 1 to itemCount
>
stuff alias i of fileList into archive item /r
>
"Screenshots" of archive "Screenshots.sit" /r
>
compression level maximum
>
end repeat
>
quit
>
end tell
>
>
end open
>
>
-------------------------------------------
>
>
This script will stuff the first item in fileList and then just quit
>
doing anything, with StuffIt Deluxe remaining the frontmost
>
application. If I activate the script again via the Application Menu,
>
it finishes executing as written and quits. The weird thing is that
>
when it is activated this way, StuffIt Deluxe does not come to the
>
front again, even though it is still finishing its tasks.
>
>
Any ideas why the script is losing control of things? Any ideas on
>
how to fix it?
>
>
FYI - OS 9.0.4 and AppleScript 1.4.3.
>
>
Thanks for any insight you might offer.
>
>
Later,
>
>
Rob Jorgensen
>
Ohio, USA
Does it work any better if you change:
stuff alias i of fileList into archive item
to
stuff (contents of item i of fileList) into archive item ?
I'm surprised that it worked at all, because lists don't have aliases as
elements, only items. The quit here tells StuffIt to quit, not the
script. Inside a tell block to an application you'd have to say "tell me
to quit" to quit the script. In this case, I think you'd have to say
"tell me to return", since quit doesn't seem to work for scripts unless
its in an idle handler. Your script terminates at the end of the open
handler, after the StuffIt tell block.
Marc [11/30/00 3:23:31 AM]