Article Preview
Buy Now
| Print: | |
| PDF: |
Feature
AppleScriptable Applications
Creating an 'aete' resource and interpreting AppleEvents
Issue: 1.5 (April/May 2003)
Author: Thomas Reed
Author Bio: Thomas Reed has been programming as a hobbyist for more than 20 years, and fell in love with the Mac in 1984.
Article Description: No description available.
Article Length (in bytes): 9,466
Starting Page Number: 30
RBD Number: 1515
Resource File(s):
1515.sit Updated: Friday, October 17, 2003 at 12:20 PM
Related Web Link(s):
http://www.panix.com/~gmcgath/EightyRez.html
Known Limitations: None
Excerpt of article text...
Given the choice between a program that supports AppleScript and a similar one that does not, many people will choose the program that is scriptable. Because of this, it is clearly advantageous to create an AppleScript interface for your application. It is a common misconception that writing scriptable applications is very difficult. This article will provide an introduction to creating AppleScript interfaces that will help dispel this myth.
AppleScripts work by translating English-like language into AppleEvents, which are then sent to the target application. Thus, there are two main aspects of AppleScripting that must be managed. First, your application must provide an AppleEvent Terminology Resource, which defines the AppleScript commands it understands. Second, you must interpret any AppleEvents sent to your application and invoke the requested behavior.
An AppleEvent Terminology Resource is a resource of type 'aete' and ID 0. It defines the various events and classes that your application understands, providing a translation from AppleScript to AppleEvents. For this article, I will describe how to create 'aete' resources using a free 'aete' editor called EightyRez, which only runs under Classic and is available from http://www.panix.com/~gmcgath/EightyRez.html.
...End of Excerpt. Please purchase the magazine to read the full article.
Article copyrighted by REALbasic Developer magazine. All rights reserved.
|










