Re: OS X: AS 1.8.2b1: ask System Events for a running process
Re: OS X: AS 1.8.2b1: ask System Events for a running process
- Subject: Re: OS X: AS 1.8.2b1: ask System Events for a running process
- From: Bill Cheeseman <email@hidden>
- Date: Sat, 02 Feb 2002 15:14:50 -0500
on 02-02-02 12:22 PM, Paul Berkowitz at email@hidden wrote:
>
>> tell application "System Events" to process 1 whose creator type is "MACS"
>
>
>
> The correct syntax is:
>
>
>
> tell application "Finder" to get every process whose creator type is "MACS"
>
>
>
> And yes, it times out for me. Using this:
>
>
As does
>
>
tell application "System Events" to get every process whose creator type is
>
"MACS"
>
>
[a more direct correction]
My understanding of the "System Events" application is that it is intended
(among other things, I assume) to provide a service to the Finder's
AppleScript implementation. Namely, to handle this and certain other
Finder-related Apple events invisibly, behind the scenes, without the
scripter's having to know that the Wizard of Oz is lurking behind the screen
and pulling the levers.
To provide consistency among scripts that might run in Mac OS 9 and Mac OS
X, or just to maintain traditional scripting style in accordance with the
Finder's dictionary, I believe one should normally 'tell application
"Finder"' to do this sort of thing. Nothing is gained by 'tell application
"System Events"', instead, so I don't.
I say I assume the System Events application serves some other purpose, too,
because I can't think why it would be there at all, otherwise. Since I don't
understand it, I worry that it might go away in some future release, which
is another reason to continue telling the Finder to do this sort of thing.
Maybe one of the Chrises can fill us in on why System Events is there.
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com
The AppleScript Sourcebook -
http://www.AppleScriptSourcebook.com
Vermont Recipes -
http://www.stepwise.com/Articles/VermontRecipes
Croquet Club of Vermont -
http://members.valley.net/croquetvermont