Subscribe / Unsubscribe Enewsletters | Login | Register

Pencil Banner

Introduction to AppleScript: What you can do with AppleScript, OS X's scripting language

Kenny Hemphill | Aug. 31, 2015
Understand and get more from AppleScript.

Macworld UK A significant number of applications have AppleScript Dictionaries

Once you start writing scripts that contain more than a handful of lines, you'll realise that hunting bugs and editing sections is much easier if you organise your code into sections with descriptions. These descriptions are known as 'comments.' To add a comment to an AppleScript, type two dashes then the text of your description, followed by another two dashes. When you compile the code, the comments are coloured grey and ignored when the script is run. If you need to, you can use commenting to prevent sections of code from being run - if you're trying to find bugs, it's more efficient to do that than delete the code and re-insert it later.

AppleScript is hugely powerful, and not nearly as difficult to learn as you might think. If this very brief introduction has whetted your appetite, fire up AppleScript Editor, go to the File menu and choose Open Dictionary to see a list of applications on your Macs with AppleScript Dictionaries. Then go to Apple's AppleScript developer resource to learn how to use them.


Previous Page  1  2  3 

Sign up for CIO Asia eNewsletters.