10 AppleScripts to make you love your Mac (even more)
Interested in getting started with AppleScript -- or delving deeper to write more sophisticated scripts? These resources will help beginners learn the basics, and will help experienced scripters improve their knowledge.
You can find more image scripts and explanation of code from AppleScript 1-2-3 posted on Apple's main AppleScript site.
Macscripter.net. A community focused specifically on AppleScript and other Apple automation tasks, Macscripter features a very helpful series of AppleScript tutorials as well as links to downloadable scripts and other resources. Members are helpful in answering questions; and I've found several solutions to scripting questions just by searching the forums.
Apple's site features a section on learning AppleScript, including sample code, essential subroutines and some text and video tutorials.
Mactopia -- from Microsoft of all places -- has a site specifically for those interested in scripting Office for the Mac, including a VBA to AppleScript migration guide.
AppleScript 1-2-3: A self-paced guide to learning ApppleScript, by Sal Soghoian and Bill Cheeseman (Peachpit Press). At 800+ pages, this isn't meant to be read cover to cover; the first seven chapters are the instructions and the rest is reference. As a reference guide alone, this is a worthwhile book for anyone who wants to get even moderately serious about AppleScript.
AppleScript: The Comprehensive Guide to Scripting and Automation on Mac OS X, Second Edition by Hanaan Rosenthal (Apress). A couple of years old now, but I saw plenty of still-useful info during a quick browse of this one, including a lot of details on calling shell scripts.
Free books or book excerpts
You can download the first chapter of AppleScript for Dummies, A Cannonball Dive into the Scripting Pool, from the "For Dummies" store (PDF format).
AppleScript for Absolute Starters is available as a free PDF download.
Satimage osax 3.4.0. This free download offers additional capabilities to native AppleScript, including regular expressions, finding and replacing literal search terms, and some mathematical functions like absolute values, sines, cosines and square roots. The Satimage osax 3.4.0 dictionary details all the new functionality.
Using AppleScript in other languages
appscript is a "high-level, user-friendly Apple event bridge that allows you to control scriptable Mac OS X applications from Python, Ruby and Objective-C. Appscript makes these languages serious alternatives to Apple's own AppleScript language for automating your Mac," according to its open-source project page.
I've tried only the Ruby version, which worked fine in my limited testing. There are several explainers online to help you get started installing and using rb-appscript, including articles at the Macdeveloper and O'Reilly Web sites.
Mac::AppleScript::Glue is a CPAN module that "allows you to write Perl code in object-oriented syntax to control Mac applications," by translating Perl to AppleScript. I haven't tried this one yet and it's fairly old (2002), but if you're comfortable in Perl and would like to add AppleScript capabilities to your code without learning the syntax, this is probably worth a try.
Have your own favorite scripts or resources? Let us know!
Read more about Operating Systems in Computerworld's Operating Systems Topic Center.
- Tablet, Laptop, or Desktop - Form (Factor) Follows Function Desktops, laptops, Ultrabooks, tablets, convertibles, and all-in-ones; suddenly hardware decisions seem a lot more complicated. To take advantage of these benefits, the savviest...
- The IT handbook for Windows 7 and Windows 8 migrations A comprehensive guide for IT departments making the switch from legacy versions of Microsoft Windows to Windows 7 and Windows 8. To date,...
- 7 Reasons Why Windows 8 is the Future Touch, cloud, BYOD and IT consumerization dominate the mindshare of IT managers. Windows 8 enters the scene with a host of features that...
- How to Modernize Your IT Infrastructure & Streamline Operations Increasing line of business demands? Shrinking IT budget? See how Red Hat can help you meet growing.
- Maximizing Availability for the Modern Data Center Check out this information-packed resource center for help in maximizing the availability of your data center - from overcoming challenges to choosing the...
- Business-driven data protection Setting up data protection infrastructures with your organizations' core mission or business in mind is key. In this webinar, the ARCserve team will... All Operating Systems White Papers | Webcasts