We are starting a new automation series where we post tutorials and tips on automating repetitive tasks and batch processing on the Mac. We will cover topics on Automator, AppleScript, Bash scripting and Ruby/Python programming. We give a brief overview to these tools and languages in the first post of the series.
### Automator and AppleScript
Mac OS X comes with Automator app to assist you to create automated tasks using an easy to use drag-and-drop user interface. Automator and its underlying AppleScript programming language is Apple’s recommended automation tool and language on the Mac. Most aspects of the Mac can be automated and controlled using the AppleScript language. Many third party OS X apps also provide an interface to allow you to control them via AppleScript.
(The definitive guide by Apple on Mac OS X automation is at [www.macosxautomation.com](http://www.macosxautomation.com/).)
AppleScript is available only on the Mac but is not the only scripting language on the Mac. Depending on the tasks at hand, there are several other choices.
### Bash Shell Scripting
Underlying the Mac user interface is an Unix operating system. Before the graphical user interface as we know it today, command-line interface is the way to interact and use computer. You access the command-line interface on Mac OS X using the Terminal app. When you start up the Terminal app, Mac OS X uses the default Bash shell to handle the command-line interface.
Bash shell is one of the standard shells in Unix or *nix like operating system such as Linux. To automate tasks, you create Bash scripts in a text file and execute them on the command-line. There is no tool such as Automator that will assist you in creating your Bash scripts, and it is not a language you will use to control user interface elements such as mouse clicks and menu.
Shell scripting is second nature for people who knows Unix and Linux. Google “bash scripting” will return you tons of useful info and tips. You can also reuse your Bash scripts on non-Mac operating system such as Linux.
### Ruby or Python Programming
[Ruby](http://www.ruby-lang.org/en/) and [Python](http://www.python.org/) are two viable alternative to shell scripting. These ‘modern’ scripting languages are often preferred over shell scripting for command-line automation.
Ruby and Python, due to their style of programming, has created two separate programming camps on the net. Most people will choose either one as their preferred language, as it takes time to learn and master a programming language. Ruby and Python are used for more than just scripting, they are also popular languages for programming the web. This is an advantage in that you can bring your knowledge of the language when you venture into web programming in the future.