• 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: Simple newbie question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Simple newbie question


  • Subject: Re: Simple newbie question
  • From: Michelle Steiner <email@hidden>
  • Date: Mon, 12 May 2008 23:40:01 -0700

On May 12, 2008, at 10:22 PM, ba95 wrote:

tell application "Finder"
try
if "App1" is not in (get every process ) then open application
"App1"
open application "App2"
end try
try
if "App1" is in (get every process ) then quit application "App1"
quit application "App2"
end try
end tell

Does not work either. Launches and then immediately quits...

From looking at the code, it appears to assume that if app1 is running, so is app2, and if app1 is not running, neither is app2. With that in mind, this should work:


-- define app1 and app2

tell application "Finder"
	try
		if "App1" is not in (get every process) then
			open application app1
			open application App2
		else
			quit application app1
			quit application App2
		end if
	end try
end tell

--
--------------------------------------------------------
      Misquotation of unattributed, trite
        metaphysical saying goes here.

  Stupid ascii               Unnecessary notice of
graphic goes here.        responsibility goes here.
---------------------------------------------------------

_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
References: 
 >Re: Simple newbie question (From: ba95 <email@hidden>)
 >Re: Simple newbie question (From: ba95 <email@hidden>)

  • Prev by Date: Re: Simple newbie question
  • Next by Date: Re: Simple newbie question
  • Previous by thread: Re: Simple newbie question
  • Next by thread: Re: Simple newbie question
  • Index(es):
    • Date
    • Thread