• 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: OS X: AS 1.8.2b1: ask System Events for a running process
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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: Christopher Nebel <email@hidden>
  • Date: Sat, 2 Feb 2002 14:05:03 -0800

On Saturday, February 2, 2002, at 12:14 PM, Bill Cheeseman wrote:

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 is essentially correct. The Finder is trying to be just another application in Mac OS X, as opposed to the heart and soul of the system as it was in classic Mac OS. As such, they are trying to divest themselves of features that don't have to do with their primary mission, which is to be an interface to the file system.

The Finder returns a special error when asked for a legacy scripting thing -- i.e., something they used to support, but don't any more -- and AppleScript forwards the request to the right place. In the case of the "process" class, that's System Events. System Events handles the request (hopefully!), and the script and scripter continue on, unaware (again, hopefully) that they weren't talking to the Finder all along.

In theory, you're not supposed to even know that System Events exists, and you're not supposed to talk to it directly, though the former is very difficult to arrange, and the latter still works. What you're supposed to do is talk to the Finder like you used to, and AppleScript will arrange things behind the scenes. If you address System Events directly, you're putting yourself at risk of breaking in the future, should we decide to move/rearrange/destroy System Events. Not that we have any immediate plans to do so, but you never know.


--Chris Nebel
AppleScript Engineering


References: 
 >Re: OS X: AS 1.8.2b1: ask System Events for a running process (From: Bill Cheeseman <email@hidden>)

  • Prev by Date: Re: OS X: AS 1.8.2b1: ask System Events for a running process
  • Next by Date: Re: Open source movement for osax writers? (was Re: Scripting Additions: Embracing the Horror of Unix)
  • Previous by thread: Re: OS X: AS 1.8.2b1: ask System Events for a running process
  • Next by thread: Re: OS X: AS 1.8.2b1: ask System Events for a running process
  • Index(es):
    • Date
    • Thread