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.
- Who does NSS Labs "Recommend" for NGFW? In 2012, NSS Labs found that most available NGFW solutions "fell short in performance and security effectiveness." In 2013 NSS Labs noted "marked...
- CIOs Deliver Productivity Breakthroughs with Intelligent Digital Signage Retailers have long recognized the influence that digital signage provides over a shopper's point-of-purchase decision making process.
- 9 Essentials for a Complete Cloud-to-Cloud Backup Solution In 9 Essentials for a Complete Cloud-to-Cloud Backup Solution, we'll walk you through potential sources of data loss in the cloud and provide...
- Workload Change: The 70 Percent of Your Business DevOps Forgot Adding WLA early in the development process ensures that the benefits of DevOps accrue for all applications, including your batch services. This paper...
- Top 4 Digital Signage Fails Join RMG Networks for a look at four of the most common reasons digital signage fails in corporate businesses. Learn about strategies to...
- Protecting Critical SaaS Data Before It's Too Late In this webinar, you'll hear how to avoid SaaS data loss through best practices from a panel of experts. All Operating Systems White Papers | Webcasts