Join Scott Simpson for an in-depth discussion in this video What is AppleScript?, part of Learning AppleScript.
AppleScript is a scripting language for the Mac that lets you work with all kinds of applications and actions. It's sort of like a glue, or a command and control language, that allows you to tell the system and a whole bunch of applications what to do. AppleScript was introduced back in 1993 with Apple System 7.1.1 operating system, and it gained some traction in the desktop publishing world. But it really took off with the launch of Mac OS X. One of the first things you're likely to notice about AppleScript when you see it is that, unlike many programming languages, it makes use of a natural language metaphor.
These two programs do basically the same thing, count from one to five and display a message with each number. AppleScript is used for all kinds of custom workflows. From adding functionality to iTunes and Mail to eliminating repetitive activities like naming a long list of files, to automating the activity of applications. For example, a few years ago, I wrote a very simple droplet application to instantly play a movie full screen in QuickTime Player. It only removed the need for a few key presses, but it filled the need we had at the time. And finally, since the launch of Mac OS X, developers have been able to take advantage of AppleScript from within native Mac applications built with Xcode.
Now, it wouldn't be fair of me not to mention Automator, which started shipping with OS 10.4. Automator is a drag-and-drop editor for workflows and it's very useful, up until it isn't. There are some things you just can't quite get it to do. And, while it's even easier to use, it's not quite as flexible as AppleScript. So Apple Script can be written in a plain text editor, but there's a free app called AppleScript Editor that comes with Mac OS X that makes building AppleScript apps a lot easier. There are other commercial apps that can build AppleScript apps as well. But in this course, I'll use the free one.
- What is AppleScript?
- Using comments, variables, text, and numbers
- Working with files and folders
- Using conditionals and creating loops
- Building functions
- Controlling other programs with AppleScript
- Preventing and catching errors
- Distributing your AppleScript application