Controlling other applications using AppleScripts
Issue: 1.1 (August/September 2002)
Author: Dean Davis
Author Bio: Dean Davis is the author of the shareware program WeatherManX and a huge AppleScript enthusiast.
Article Description: Controlling other applications with AppleScripts
Article Length (in bytes): 5,009
Starting Page Number: 42
Article Number: 1013
1013.zip Updated: 2013-03-11 19:07:55
Related Link(s): None
Excerpt of article text...
AppleScript has always been one of the best-kept secrets of the Macintosh world. Most users know it exists but haven&t taken the steps to harness its powers. REALbasic does a very good job at integrating AppleScript technology into its architecture.
AppleScript allows your application to control, or be controlled, by other applications. With proper programming, this interaction between programs can work across a network, even the internet. Letting other applications control a REALbasic program is done using AppleEvents and is a topic for another article. Teaching AppleScript is also out of the scope of this column.
Controlling other programs can be accomplished in two different ways. The controlling program can create and send AppleEvents to a target program, or the controlling program can call a compiled AppleScript &program.& The former is the more powerful method but is more difficult to program; the latter method is limited but very easy to program. We will concentrate on the latter method with this column.
A program can utilize three different types of scripts. The first type are simple, where the script simply accomplishes a task. Emptying the Trash is a good example.
tell application "Finder"
...End of Excerpt. Please purchase the magazine to read the full article.