Making your app scriptable
Issue: 9.1 (November/December 2010)
Author: Marc Zeedar editor-at-rbdeveloper.com
Article Description: No description available.
Article Length (in bytes): 19,668
Starting Page Number: 68
RBD Number: 9109
9109project.zip Updated: Monday, November 1, 2010 at 6:57 PM
Related Web Link(s):
Known Limitations: None
Excerpt of article text...
A common question among REAL Studio users is how to make their applications AppleScriptable. AppleScript, if you're not familiar with it, is Apple's system-wide scripting language for Mac OS X. It works in conjunction with AppleEvents, which is a system of interapplication communication (basically, a communication system that lets apps talk to each other). AppleScript is essentially the bridge between those apps.
Fully supporting AppleEvents is tremendously complex and far beyond the scope of this simple column. Entire books have been written on the subject and I'm sure they're incomplete. It's virtually a black art known only to a few gurus.
So what do you do? You want your app to be scriptable, but you don't have the expertise and time to make it so. Today I'm going to demonstrate a shortcut. We're going to cheat!
The "normal" way of making your app scriptable is to use a resource editor to build an "aete" resource that contains all of the script commands your app will support. Just setting up one or two simple commands like this isn't easy (as you will see later). Each command must be specified in detail, along with its parameters and a million other settings. Establishing an entire scripting language for your app is best left for AppleEvent experts. Seriously. Not fun. At all.
...End of Excerpt. Please purchase the magazine to read the full article.
Article copyrighted by REALbasic Developer magazine. All rights reserved.