Automation #2 – Difference Between AppleScript and Automator

AppleScript is the scripting language Apple designed for end-users and is build into Mac operating system. AppleScript has been around for a long time, since System 7 in 1993. AppleScript looks a lot like natural language, and you can use it to control applications, script user interface elements, access and modify application documents, pass data between different applications and access operating systems resources.

For example, you can use AppleScript to create a workflow that automate the export of photos in iPhoto, reduce its size, rename the photos and FTP upload to web gallery. With the latest version of AppleScript in Mac OS X 10.5, you can create a complete Cocoa GUI application using AppleScript.

One reason for the power of AppleScript is its ability to script and control different applications. With the introduction of Mac OS X and Cocoa frameworks around 2002, Apple has make it easy for developer to create applications that can be scripted using AppleScript by defining a standard object model and interface.

To get a taste of AppleScript, launch the Script Editor app which is under Applications>AppleScript folder. Key in the text ‘say “Hello World”‘ into the text area. Press the **”Run”** button to execute the script.

![AppleScript Script Editor](

We will be looking into more AppleScript for sure in future posts. Let’s turn to a different tool Automator, which was first released with Mac OS X 10.4 Tiger for automating repetitive tasks. New Apple users sometimes are confused about the difference between AppleScript vs Automator.

Automator has a click-and-drop user interface and is designed for ease of use. You create automated tasks in Automator without the need to write programming codes. Automator does not replace AppleScript and it is not a graphical tool to help you create AppleScript.

In Automator, you program repetitive tasks by creating a workflow. A workflow consists of one or more Actions which you assembled by choosing and dragging the available Actions template to form your workflow. Automator is simple to use, requires no programming knowledge and is great if you just want to create some workflow fast.

Apple has provided over 250 Actions in the library for your Automator workflows. These pre-installed actions include actions to:

* control apps such as iCal, Mail, Safari, Image Capture, iTunes, iPhoto etc
* manipulate Finder, files and folders
* image actions such as capture, crop and scale images
* automate editing PDFs
* automate RSS for accessing and extracting web content
* access web services using SOAP and XML-RPC

Actions is build on extensible architecture for you to add new actions from third-party or actions created by you. You can create Automator actions using AppleScript or Unix shell scripts, and thus extending the capability and solve the limitation of Automator. If you do not know any programming, you are limited by the available Actions in the library.

If you are new to programming and automation, Automator is a good start for you to understand what is involved. With Automator, you depend on the supplied Actions if you do not want to dealt into programming. On the other hand, you might want to jump into learning AppleScript straight away, as it gives you all the power you required for automation.

Someone with programming experience will most likely stick with AppleScript, and only use Automator for quick and simple workflow.