• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 21. AppleScript > Script Editor

Script Editor

The easiest way to get started with AppleScript is with the AppleScript editor. Besides being a context-sensitive programming editor, it also acts as a script recorder. A user can open the Script Editor, click record, and generate an AppleScript by using the editor to monitor his actions while interacting with an AppleScriptable application.

Note

It's critical to note that AppleScript (and the AppleScript editor) should not be considered a macro system. Macro applications, such as QuicKeys, work by simulating user input to applications. This is very similar to shell scripting. From the application's perspective, a user is controlling it.

When AppleScript controls an application, the application understands what is happening. It can return error codes and extended status to the script, enabling it to react and adapt to changing conditions. AppleScript is a very powerful tool and offers flexibility beyond simple macros. The drawback? An application is AppleScriptable only if it is designed to be.

(This isn't to downplay tools such as QuicKeys, which integrate virtual user capabilities with AppleScript for complete scripting solutions. In fact, I recommend users take a look at QuicKeys for an example of an excellent integrated Mac OS X scripting solution. The Web site is http://www.cesoft.com/products/qkx.html.)



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint