Mac OS X Reference Library Apple Developer
Search

AttachAScript

Last Revision:
Version 1.0, 2006-07-27
Illustrates how you can extend any Cocoa application by adding some AppleScripts to it.
Build Requirements:
Xcode 2.3
Runtime Requirements:
This app uses Apple events to communicate over TCP/IP so you must have "Remote Apple Events" turned on in the "Sharing" pane of the "System Preferences" before you can run the application.

If your application needs to communicate with other applications or processes, it can use AppleScript as a communication layer. Using the techniques described here, the included scripts handle all of the communication details while your application just makes calls to the scripting machinery. This design allows you to modularize the part of your application concerned with interprocess communication. The scripts are stored in the application's Resources folder and can be tuned in the field for particular needs and requirements, potentially by end users, without needing to recompile the application. This sample targets the iTunes application, using remote Apple events over a network. The scripts handle all of the details involved in communicating with iTunes, while the program provides the user interface.




Last updated: 2006-07-27

Did this document help you? Yes It's good, but... Not helpful...