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

Simple newbie question


  • Subject: Simple newbie question
  • From: ba95 <email@hidden>
  • Date: Tue, 13 May 2008 08:58:59 +0200


Le 13 mai 08 à 08:41, Michelle Steiner a écrit :

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

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

--

Thanks a lot Michelle. Unfortunately the script does not work here.

Launching time: only "App1" is opened
Quiting time: nothing happens.

Who sais AS was an easy langage... ? ;-)


_______________________________________________ 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
  • Follow-Ups:
    • Re: Simple newbie question
      • From: Michelle Steiner <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