REFERENCES FOR LEARNING & USING APPLESCRIPT Modified: 2018/06/19 18:47
AppleScript is a rather peculiar scripting language to learn.
Its so-called natural language syntax is loved by some and hated by others.
It has a relatively small core language, but many if not most scriptable applications have terminology and syntax unique to that app. This means you have to be willing to learn the quirks of every new app you work with.
You can become an absolute expert at scripting BBEdit and not understand much about scripting Capture One.
Fortunately many apps have similar ways of doing things, so the more you learn the more intuitively you can puzzle out idiosyncrasies in new apps. Nevertheless it's a good idea to reach out for help if you've been beating your head against the wall for more than an hour or two. Dain brammage isn't of much use to anyone.
Despite AppleScript's quirks it is an enormous productivity enhancer for me.
When it debuted in 1993 I thought it was junk, but a year or two later an OSAX (library) came out that added regular expression support to AppleScript. That simple addition plus the productivity utilities I already had like QuicKeys and KeyQuencer allowed me to rapidly process text and do many other things most Mac-users never even thought of, so I was off to the races.
The Applescript Users List
http://lists.apple.com/mailman/listinfo/applescript-users
MacScripter.net
APPLESCRIPT & MAC AUTOMATION WEBSITES
Published personally by Sal Soghoian — a long-time Apple employee and AppleScript Maven.
455 (and counting) AppleScripts for Apple's iTunes that will help make managing your digital music collection easier and more fun!
http://dougscripts.com/itunes/
APPLESCRIPT TUTORIALS
A very, very basic tutorial. It's old but still pretty relevant.
OFFICIAL APPLESCRIPT DOCUMENTATION — THE APPLESCRIPT LANGUAGE GUIDE
If you're going to work with Applescript you need access to The Applescript Language Guide.
It is a syntax reference and not a tutorial.
Downloadable PDF:
https://applescriptlibrary.files.wordpress.com/2013/11/applescriptlanguageguide-2013.pdf
Apple quite shamefully has stopped producing PDF verions of the ASLG, but the 2013 version (for 10.9.x) is still available. Download it, so you have a local searchable copy. It won't be complete, but it's still a handy reference.
Online Version (up-to-date):
APPLESCRIPT BOOKS I RECOMMEND
NOTE: Trying to learn Applescript without buying at least one good reference is a fool's errand.
Learn AppleScript: The Comprehensive Guide to Scripting and Automation on Mac OS X by Hamish Sanderson & Hanaan Rosenthal
APPLESCRIPT BOOKS I HAVE NOT EVALUATED
AppleScript 1-2-3: A Self-Paced Guide to Learning AppleScript (Apple Pro Training Series) by Sal Soghoian and Bill Cheeseman
ESSENTIAL AUTOMATION UTILITIES
NOTE: If you have Keyboard Maestro you really don't need FastScripts, however I like how FS' UI works — so I use both utilities on my system.
FastScripts is an enhanced replacement for Apple's own AppleScript menu.
It provides many usability improvements, a refined UI, Global & App-Specific Keyboard Shortcuts. It is scripting language agnostic and handles AppleScript, Perl, any language recognized by the shell, Automator workflows — even applications or documents.
I've used it since 2003.
https://red-sweater.com/fastscripts/
Keyboard Maestro goes far beyond running AppleScripts
Whether you are a power user or a grandparent (or both!), your time is precious. So why waste it when Keyboard Maestro can help improve almost every aspect of using your Mac. Even the simplest things, like typing your email address, or going to Gmail or Facebook, launching Pages, or duplicating a line, all take time and add frustration.
I've used the OSX version since 2003 (and used the old Mac OS version for many years before that).
http://www.keyboardmaestro.com/main/
APPLESCRIPT EDITORS
The Apple-Provided 'Script Editor' (pre-Snow Leopard) and 'Applescript Editor' (Snow Leopard & Lion) is not a bad editor and provides searchable access to application dictionaries. (It has been renamed to 'Script Editor' again in Yosemite.)
When I began scripting Apple's Script Editor didn't even have find/replace. After some months of fighting with it I gave up and spent $129.95 (in 1995) on Script Debugger v1.0 after evaluating both it and Scripter.
You wouldn't believe how much aggravation that purchase (and upgrades) has saved me.
A powerful and useful Applescript Development Environment. Using a Terminal window you can step through scripts line-by-line. Although this is not as convenient as in Script Debugger it's better than the Applescript Editor can do.
Smile can create custom dialogs, open web pages and process them, create scientific graphs, and many other things.
A small excerpt:
• Extract data from files (default data formats supported: text, binary, FITS, XNF, ...), • Perform data processing using commands provided with Smile or controlling external code • Visualize your data in the most usual forms (curves, scatter plots, bar graphs, contour lines, color maps and vector fields in 2D, and 3D surfaces) • Customize the interaction of the user with the plots (handling mouse clicks, contextual menus, keyboard events...) and create custom interfaces • Export your plot as a PDF file, as a bitmap picture (PNG, JPEG, TIFF, BMP, PSD) or as a QuickTime movie.
Full feature list:
http://www.satimage.fr/software/en/smilelab/gallery/smile_features.html
Downloads:
http://www.satimage.fr/software/en/downloads/index.html
I do primary development with Script Debugger, but I always keep Smile on my system for testing and other jobs.
An OSAX or Open Scripting Architecture Extension is a library that adds features to AppleScript.
The Satimage.osax from Satimage is a companion to the Smile AppleScript Editor, but it is available as a stand-alone component.
http://www.satimage.fr/software/en/downloads/downloads_companion_osaxen.html
There are several more available on this page, but the one I MUST have on my system is the Satimage.osax.
It adds regular expression support and many other useful features to AppleScript.
SCRIPTABLE PLAIN-TEXT EDITORS
Programming & HTML Editor Extraordinaire.
Mightily Scriptable.
http://www.barebones.com/products/bbedit/
If you work with plain text documents and don't own BBEdit do yourself a favor and install it.
http://www.barebones.com/products/textwrangler/index.html
SCRIPTABLE STYLED-TEXT EDITORS
A highly scriptable styled-text editor and very useful for learning Applescript. The unregistered version is not crippled in any way.
A Cocoa text editor — yet another super TextEdit for plain and rich text.
Far more scriptable than TextEdit.
http://www.artman21.com/en/jedit_x/
USEFUL APPLESCRIPT TOOLS
A script editor that takes advantage of AppleScript's ability to call Cocoa methods in OS X 10.6 and later.
http://www.macosxautomation.com/applescript/apps/explorer.html
A utility for exploring AppleScript GUI Scripting and Accessibility technologies.
The price seems a litte steep, but if you need to develop scripts using System Events and GUI-Scripting this vital tool will keep you from pulling your hair out.
http://pfiddlesoft.com/uibrowser/
Brings AppleScript "Attachability" to all OSX Applications
Attach a UI Action script to any standard native Mac OS X application, and UI Actions automatically runs the script whenever you perform specified user actions in the target application. You write the script, and you select the user action that triggers it, such as choosing a menu item, changing the value of a text field, opening a drawer or window, or activating an application.
A developer tool that can be used to create native, flawlessly integrated Mac OS X applications from interpreted scripts such as shell scripts or Perl and Python programs.
http://www.sveinbjorn.org/platypus
A collection of Objective-C files that simplify some of the coding involved in AppleScriptObjC.
http://www.macosxautomation.com/applescript/apps/helpers.html
A simple application for triggering AppleScripts or shell scripts whenever certain events occur.
http://mousedown.net/mouseware/EventScripts.html
An small utility application which allows you to do useful things with JSON (JavaScript Object Notation) directly from AppleScript.
https://itunes.apple.com/us/app/json-helper-for-applescript/id453114608
https://itunes.apple.com/us/app/location-helper-for-applescript/id488536386
Brings the power of Core Location to AppleScript
@ccstone It would seem that the tutorial at http://files.macscripter.net/sourcebook/AS4ASb2.pdf is no longer there (d’oh).
I realize that this might be a long shot, but by any chance might you happen to know its new URL? (Or might you have a local copy of that PDF that you could share?)