• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: App and droplet
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: App and droplet
      • From: Craig Stanton <email@hidden>
    • Re: App and droplet
      • From: Craig Stanton <email@hidden>
References: 
 >App and droplet (From: Craig Stanton <email@hidden>)

  • Prev by Date: Re: App and droplet
  • Next by Date: Re: scripting BOMArchiveHelper possible ?
  • Previous by thread: Re: App and droplet
  • Next by thread: Re: App and droplet
  • Index(es):
    • Date
    • Thread