Applescript, that amazing resource many Mac users ignore because they think it’s too complex. Guys, Applescript is an amazing tool to get things done automatically, though I recognize many of you just don’t want to get started because you don’t have the right motivation, or you just don’t know enough about it. I wrote a post which collected the best examples of Applescript but still, there wasn’t a real introduction.
That’s why I asked my friend Jesse from iScript Netcast to get started on a posts series about Applescript. There will be 3 parts, where Jesse will outline the pros and cons of Applescript, together with some sample scripts and tips for beginners.You can also get in touch with iScript Netcast on Twitter here.
Enjoy!
What is AppleScript?
Ever since the first personal computer, people have looked for ways to make their computers do things automatically. We buy apps all the time to make our lives easier. However, sometimes those apps aren’t quite enough,sometimes we need more functionality or need more automation than that provided by the application. Apple began in version 7 of their operating system to ship a tool that the average end-users could learn and use to their advantage, a tool called AppleScript.
AppleScript is an english-based interpreted programming language. This means that you do not have to be a programmer to learn how to write AppleScript. If you can speak english and write sentences similar to…
Tell application “iTunes” to play
…then you can write AppleScript. The “interpreted language” simply means that Mac OS simply executes your commands on the fly. This makes AppleScript very easy to troubleshoot since you can watch as it interacts with the system and other applications.
Why Use AppleScript?
AppleScript is designed to make your life easier by allowing every Mac owner to automate tasks they perform every day. We are creatures of habit, we all have some sort of routine we go through every time we turn on our computer at home, work or on the road. AppleScript is a great way to make those mundane and often times annoying tasks go away… Forever.
Another reason to make AppleScript your automation language of choice is because of its tight integration with the applications you already know and love in OS X. It can help improve them or can make them work together. Many of the actions which make the iLife suite (iTunes, iPhoto, iMovie, and iDVD) work so well together are just simple AppleScripts.
How do I Begin?
Anytime you want to learn something new the best thing to do is have a reason for learning it. Learning a programming language, like AppleScript, is no different. Think of something you do on your computer day-in and day-out that is a repetitive task. It doesn’t have to be anything intense or even spectacular. Simple renaming of files or organization of iTunes tracks will do!
Next, set out to accomplish writing your script. Don’t let yourself get frustrated by initial failure. AppleScript is an easy language learn but the concepts of programming can often be difficult. Having a book can often help get you started on the concepts of application development as well as the syntax of AppleScript. An older but excellent resource is O’Reilly’s book entitled “AppleScript: The Definitive Guide”.
While it is a few years out of date it still will get you on the right track.
What’s Next?
This concludes part one of your introduction to AppleScript. Next time I will include some sample scriptlets from some of my first scripts as well as more ideas on what you could script to start automating your computer and your life with AppleScript.
Happy Scripting!