Re: Carbon vs Cocoa arguments
Re: Carbon vs Cocoa arguments
- Subject: Re: Carbon vs Cocoa arguments
- From: Bill Cheeseman <email@hidden>
- Date: Fri, 11 Oct 2002 09:01:55 -0400
on 02-10-11 4:20 AM, Rosyna at email@hidden wrote:
>
What is System Events? The Standard Additions OSAX is the one that
>
handles the AppleScript for the system, if thats what you mean?
>
>
Ack, at 10/10/02, Bill Cheeseman said:
>
>
> Why do you put a question mark after System Events? Its AppleScript support
>
> is now vastly increased, allowing scripters to control the file system
>
> without being tied to Finder, to add and remove Folder Actions (AppleScripts
>
> attached to folders) for the first time since Mac OS 9, to add and remove
>
> items from the Login Items list, and other things.
No. The Standard Additions OSAX does have a number of commands that are
considered standard in any AppleScript implementation, including the
read/write commands that let you create, write and read text and other files
via AppleScript. But it is ancillary to the main AppleScript command set
(i.e., the AppleScript language). The language and engine reside in the
AppleScript component in /System/Library/Components. The Finder contains a
great many commands of its own for scripting the file system, processes, and
other aspects of the system. In addition, an increasing number of
applications installed by the system installer are themselves scriptable,
such as Help Viewer, Apple System Profiler, System Preferences, and others.
For many years, the Finder has been the primary focus of file system and
system AppleScripting, both in the classic Mac OS and on Mac OS X. It is
true that Standard Additions has some older commands (it predates the
scriptable Finder) that can be used as alternatives to access the file
system, but the Finder's commands are much more extensive and powerful.
One or two releases ago, the Mac OS X System Events application began to
take on some of the Finder's AppleScript file system and processes
responsibilities. You could still send these Apple events to the Finder, but
the Finder passed them along to the System Events application for execution
(and, behind the scenes, the loginwindow application may play a role, too).
Now, in Jaguar, the System Events application has acquired substantial
additional AppleScript support, and Apple's AppleScript team now recommends
that the commands it supports be sent directly to the System Events
application. System Events now implements many AppleScript commands that the
Finder does not implement, and the ones that the Finder also implements are
now marked as deprecated (or "legacy") in the Finder.
The System Events and loginwindow applications are in
/System/Library/CoreServices. You can drag the System Events application to
the Script Editor icon in /Applications/AppleScript to see its scripting
terminology dictionary. There is more information about it in the
AppleScript 1.9 (Jaguar) Release Notes at
<
http://www.apple.com/applescript/release_notes/190OSX.html>. (The
loginwindow application does not have a dictionary, but you can send what
AppleScripters call "raw events" to it, anyway, if you know what their codes
are.)
Later today, you can read my new AppleScript Sourcebook report on
AppleScript 1.9 in Mac OS X 10.2 (Jaguar) at
<
http://www.AppleScriptSourcebook.com/applescript/applescript190.html>. It
contains more information about the System Events and loginwindow
applications.
--
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
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.