Re: App and droplet
Re: App and droplet
- Subject: Re: App and droplet
- From: kai <email@hidden>
- Date: Wed, 11 Oct 2006 19:56:51 +0100
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 (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden