• 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: Recording AppleEvent Class Codes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Recording AppleEvent Class Codes


  • Subject: Re: Recording AppleEvent Class Codes
  • From: Kaydell Leavitt <email@hidden>
  • Date: Fri, 16 Aug 2013 15:45:56 -0600

On Jul 26, 2013, at 7:38 AM, Alex Zavatone <email@hidden> wrote:

Is there a collected table of these anywhere?

On Jul 26, 2013, at 8:15 AM, Shane Stanley wrote:

On 26/07/2013, at 10:10 PM, Kaydell Leavitt <email@hidden> wrote:

How do you  come up with these AppleEvent class codes such as: «class bAl8»

Script Debugger. You can display raw syntax in both scripts and dictionaries, as well as search dictionaries based on the codes. 

Hi Alex,

Apple used to have what they called the "AppleEvent Registry".  I suppose that they don't have it anymore because third-party developers were always changing their AppleEvent suites.

Apple still keeps a registry of its standard code such as those used for AppleScript classes for types, and for standard AppleEvent codes.  If you search Apple's dot-h files for a file named "ASRegistry.h" it is kind of interesting to look at.  It is a C file, it's possible to understand the gist of it even though it only has a few comments.

In addition to the header files, Apple has some legacy documentation available on the web at the following URL:

http://developer.apple.com/legacy/library/documentation/Carbon/reference/Open_Scripti_Architecture/Open_Scripti_Architecture.pdf

If you search this document for "ASRegistry.h", you can find some information about AppleScript's 4-letter codes (OSTypes).

In addition to ASRegistry.h, which defines the OSTypes for AppleScript, there is a dot-h file that defines the OSTypes for AppleEvents called AERegistry.h

Then there is FinderRegistry.h.

As for the  rest of Apple's AppleEvent suites, each scriptable app has an XML file which is either in the application bundle or is generated by the app at run time.

It is possible to do the following to view any scriptable app's, scripting dictionary file, an .sdef file, in it's "raw format". The raw format is a plain text file, in an XML format, that is human-readable. It isn't quite as nice of a user-interface as viewing scripting dictionaries in AppleScript Editor's GUIs Dictionary window, but if you want to take a "peek under the covers", it is interesting to look at the Scripting Dictionary files as XML files.

To see any scriptable application's Scripting Dictionary in XML format, you can do the following.

1. Start AppleScript Editor.
2. Choose from the menus: "File > Open Scripting Dictionary..."
3. You will have a list of scriptable applications to choose from.
4. Find the application that you want to see the OSType codes for.
5. Holding down the command-key, click on the title
6. Choose the first folder in the popup menu
7. This will take you to the Finder, where you can see the Scripting Dictionary File, an .sdef file in the Finder.
8. Holding down the option key, to make a copy, drag this file to your desktop.
9. Open this file up in a plain text editor such as Xcode.

You will be viewing an XML file which is what developers type in to define codes for commands, and classes and such.

So back to the original question.  Although there isn't a collected table of these AppleEvent and AppleScript codes, you still can figure out the "raw codes" that AppleScript and AppleEvents uses.

-- Kaydell
email@hidden
http://learnbymac.com

 _______________________________________________
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: Recording AppleEvent Class Codes
      • From: Shane Stanley <email@hidden>
  • Prev by Date: Re: OSAScriptView - documentation?
  • Next by Date: Re: Recording AppleEvent Class Codes
  • Previous by thread: Re: OSAScriptView - documentation?
  • Next by thread: Re: Recording AppleEvent Class Codes
  • Index(es):
    • Date
    • Thread