Special

Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 21 in printed book and digital formats -- plus a one-year subscription (beginning with 22.1) so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview


Buy Now

Issue 1.3

COLUMN

Controlling other applications using AppleEvents

Control other programs using Apple Events

Issue: 1.3 (December/January 2002)
Author: Dean Davis
Author Bio: Dean Davis runs AfterTen Software and is the creator of WeatherManX. He believes most programs should have some form of AppleScript interaction
Article Description: No description available.
Article Length (in bytes): 8,804
Starting Page Number: 42
Article Number: 1322
Resource File(s):

Download Icon 1322.zip Updated: 2013-03-11 19:07:56

Related Web Link(s):

http://www.westcodesoft.com/downloads/octools.html

Excerpt of article text...

Using compiled AppleScripts is an easy way to get control over other applications but it has its limitations. Using raw AppleEvents gives you almost all the power you need to dynamically control other applications.

In this article we'll rewrite the AppleScripts from issue 1.1 using AppleEvents. The example application includes all the original AppleScripts plus the equivalent AppleEvents.

A new AppleEvent is created using the "NewAppleEvent" function. In its simplest form it takes as parameters the event class, the event ID, the target application's creator code, and returns an "AppleEvent" object. The best example is the famous "Empty Trash" AppleScript.

Tell application "Finder"

Empty trash

...End of Excerpt. Please purchase the magazine to read the full article.