• 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: check a process
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: check a process


  • Subject: Re: check a process
  • From: Nigel Smith <email@hidden>
  • Date: Tue, 23 Dec 2003 09:45:49 +0000

On 18/12/03 12:25, "Jim Brandt" <email@hidden> wrote:

> Specifically, I want to know if the Classic environment is running
> before I try to launch a OS9 application.

If you know a particular process always runs in Classic, you could test for
that. For example, my Classic has the Suitcase extension installed so I can
do:
tell application "System Events"
if (name of every process as text) contains "Suitcase 9" then
return true
else
return false
end if
end tell

Otherwise you could use the shell -- note that the first "grep" finds all
matches in the ps listing, possibly including the "grep" command itself, so
the second "grep" omits all "grep" commands...

The "if...then" part is all one line:

if (do shell script "ps -auxww | grep TruBlueEnvironment | grep -v
grep") = "" then
return false
else
return true
end if

HTH,

Nigel
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: check a process
      • From: Christopher Nebel <email@hidden>
    • Re: check a process
      • From: Joshua See <email@hidden>
References: 
 >check a process (From: Jim Brandt <email@hidden>)

  • Prev by Date: Re: Getting time components of date
  • Next by Date: Re: Getting time components of date
  • Previous by thread: check a process
  • Next by thread: Re: check a process
  • Index(es):
    • Date
    • Thread