Re: App and droplet
Re: App and droplet
- Subject: Re: App and droplet
- From: Craig Stanton <email@hidden>
- Date: Thu, 12 Oct 2006 19:16:46 +1300
Close but no cigar. It seems to me that the property really_quit is
reset every time. So as soon as I drop something on it, the
really_quit is made true and when it reaches the end of the loop is
quits, even if I had set it to false in the on-run handler. I need
some other way of holding a variable during the session :-/
~Craig
On 12/10/2006, at 7:56 AM, kai wrote:
On 11 Oct 2006, at 18:33, Craig Stanton wrote:
Is there a good way to make a script quit when it was started with
drag-and-drop, but stay open if it was started by double clicking?
Sure, Craig - although you'd also need to consider a way to let the
user quit when required (short of a force-quit). The following
method, which should obviously be saved as a stay-open app, uses a
second double-click (reopen) to give the user that option:
--------
property really_quit : true
on open some_list
(* do something with some_list *)
if really_quit then quit
end open
on reopen
display dialog "Quit this application?"
set really_quit to true
quit
end reopen
on run
set really_quit to false
end run
--------
Another way would be to place the conditional statement in a quit
handler:
--------
property really_quit : true
on open some_list
(* do something with some_list *)
quit
end open
on reopen
display dialog "Quit this application?"
set really_quit to true
quit
end reopen
on quit
if really_quit then continue quit
end quit
on run
set really_quit to false
end run
--------
---
kai
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (AppleScript-
email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden