Chapter 5. AppleScript Basics

IN THIS CHAPTER

  • What is AppleScript?

  • A brief history of AppleScript

  • Why AppleScript?

  • The AppleScript Editor menus

  • The Script menu

Now that you've had a thorough introduction to Automator, the next ten chapters will introduce you to AppleScript. By the time you're done with these chapters, you'll be able to create just about any script you need for just about any situation you might encounter.

This knowledge of AppleScript will also come in handy as you continue to work with Automator. The projects in Part III will involve some tweaking of workflows using AppleScript. In some cases, as your expertise grows, you might find it easier or faster to simply create automation scripts directly in AppleScript instead of working with Automator. Or you may use both Automator and AppleScript in conjunction.

What Is AppleScript?

AppleScript is a scripting language built into Mac OS X. If you're looking for some kind of parallel to other systems, it's much like shell scripting in UNIX or Windows Batch programming, although in many respects it is different from both of these.

Here are the essentials that you need to know about AppleScript:

  • Starting with AppleScript 2.0, the character set is Unicode.

  • You can only use upper- and lowercase letters, numbers, and the underscore (_) character when you name your variables, objects, and other items. All of these identifiers must also start with a letter to be valid.

  • AppleScript is not case-sensitive; myVariable is equivalent to myvariable ...

Get Apple® Automator with AppleScript® Bible now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.