MacOS Automation: Accessing Academic Resources

Keyboard Maestro Textexpander.png

I shared an iOS Shortcut recently for opening academic journal articles via EZProxy. It’s a simple trick to short circuit the tedious cut and paste method . All it does is copy the EZproxy address 1 to the start of a url to give you access to resources via your own university library. Here are a couple of simple methods for doing the same thing using macOs automation tools.

Open Closed Access Journals with EZProxy and Keyboard Maestro

I am slowly coming to terms with some of the intricacies of macOS automation. Even so, I find Keyboard Maestro can be a little overwhelming at times. For one thing, it has a seriously misleading name, going well beyond the keyboard to hook into anything you could possibly want to do with macOs automation. The good news is you don’t have to be a coding grand master for it to be useful. This little macro is proof of that. Keyboard maestro can even simulate keystrokes, so using this method can even save you from hitting return.

macOS Automation Keyboard Maestro
Keyboard Maestro can simulate system shortcuts and keystrokes so one hotkey can do all the work

Automate EZProxy with TextExpander

Built in Macros come standard with any decent text expansion app. I’m still using TextExpander, simply because there are no alternatives on iOS. As good as it is, the fact that I have Alfred on hand means TextExpander could probably be made redundant on macOS.

To make this work with TextExpander use the builtin macros to both grab the system clipboard macro and simulate keystrokes. My snippet looks like this:

http://ezproxy.auckland.ac.nz/login?url=%clipboard %key:return%

Obviously, you need to copy the URL before you type the abbreviation so you’re a keystroke ahead with the Keyboard Maestro version, if that matters to you.

macOS Automation
TextExpander's builtin macros can add the system clipboardd to a snippet, simulate keystrokes, and more

Other Options

I already mentioned Alfred, which is easily as powerful as Keyboard Maestro. This would be a trivial problem to solve with Alfred, either by creating a workflow, or by using Alfred’s text expansion utility.

Another option is to use a clipboard manager. With Copied, for example, you can setup templates to transform the text you copy, and activate them with hotkeys. Similar functionality can be found in Pastebot. 2

  1. Most university libraries, and some public libraries have an EZProxy address, it shouldn’t be too difficult to find one you can access.
  2. Unfortunately, neither app has been updated in a while, so I can’t vouch for their longevity. Copied is still working perfectly for me on macOS Mojave

Automating Academic Workflows on a Mac – Part I

If ever I find myself in one of those tedious Mac versus Windows conversations I need only point to one thing that tips the balance toward the Apple machine, and that is automation. While it is true that automation software is not the exclusive domain of the Mac, Apple’s historical commitment to it has not only lowered the bar for entry to native automation, but has fostered a platform which has seen a slew of wonderful third-party tools that will allow anyone with a little time and determination to dip their toes in the automation waters. Honestly, it is embarrassing to admit the amount of time I might have saved had I have embraced some of these technologies early than I did. Admittedly, with services like IFTTT and Zapier, automation is becoming less and less platform dependant, but whether you want to go full nerd, or simply save yourself and your fingers from repetitive typing tasks, there is nothing like the Mac for getting started.

This will be another post in parts, there are far too many options for Mac automation to throw them all on a page and hope for that to be useful. The intention is to give you some ideas for getting started with this automation racket.

Text Expander

Perhaps the easiest area to begin is with text expansion. Limited support for text replacement is available natively in macOS, or you go further with apps like Typinator or aText. My favourite app for the job, and probably the most powerful of the lot, is Text Expander . Start with simple things, like commonly used email addresses, your own personal details, signatures or often repeated phrases.

Automating Academic Workflows Macos 4
One of its many tricks, Text Expander has built in macros for automatically formatting dates

Something I have found particularly useful is converting clumsy English spelling of non-English words and names. For example, my thesis contains a number of Māori words that have macrons for long vowels, Text Expander makes sure I neither forget nor mess up the spellings of those words. Likewise for accented European names like Zupancic to Zupančič. The more you use text expansion, the more you will start to notice commonly used text you can automate, and this is to barely scratch the surface of what a tool like Text Expander can do for you.

Smile’s Text Expander Blog is full of examples of how to use snippets in your workflow. One specifically research based use case is to setup snippets for common web searches. For more ideas on how to get started, Zapier have a nice write up on their blog you might like to check out.

Automator

Automator can seem a little daunting at first, and to be fair the user interface is not all that enticing. But, don’t let that stop you from messing around with it. Just as there are many text based tasks that you might not know you can automate, there are many more fiddly and tedious jobs littered throughout most people’s workflows. Academic workflows, in particular, are usually littered with tasks ripe for automation, and this is in no way limited to university work itself. If you are a blogger, an artist, or even a social-media junkie, chances are there is something you do regularly that you can reclaim significant time from. Having said that, like anything the problem is knowing where to start. There are a number of good Automator resources available, but you will never go wrong by starting with Sal Soghoian – the undisputed Jedi Master of Mac automation – at his Mac OS X Automation site.

In the meantime, here are a couple of basic examples to get you started. One of the most commonly cited examples of a basic Automator workflow combines selected PDF files into one document, like so:

Automating Academic Workflows Macos
Automator workflows can be setup as services to manage repetitive actions with a right-click

Another quick and dirty example of an Automator workflow is the one I use to resize images for blog posts. I have it setup as a service, so when I right click on an image and select the service, it simply scales the image, converts it, and renames the file. It looks like this:

Automating Academic Workflows Macos 2
Automator Workflows don't need to be complex, all this does is resize images, and rename the files. You can download a copy of this workflow below

You can even setup Automator do some of your research for you by setting up a feed with keywords and collecting the URLs for the articles it returns. This article has an example of one such workflow, along with a means for downloading images and video, and setting up a native, standalone web application for sites you have to keep open.

Hazel

Something all students and academics have to deal with a constant influx of digital documents. Whether they be absurdly arcane forms, journal articles, ebooks, expense claims, or whatever, they never stop piling up. Enter Hazel, put a little time into this thing and you can wipe your hands of repetitive file management and processing tasks. And, it’s not just the mundane and simple jobs either, Hazel can encode media, manage your photo library, add music to iTunes, use pattern matching to rename and file documents based upon their contents, run scripts, take care of your desktop, trash and downloads – in fact, like most good automation, it is more limited by a user’s ability to think of how to use it than by its own features. A little imagination and you can chain all kinds of services together, for example, there are party people who like to trigger their own welcome home soundtracks by using Hazel with Dropbox and IFTTT.

There is nothing overly difficult about setting up Hazel, start out simple and go from there. If you have ever setup a smart folder on iTunes, or in the Finder, then you will already have a sense of how to put an action together. If you haven’t, it looks like this:

Automating Academic Workflows Macos 3
Trigger Hazel actions by setting up conditions as you would in a Smart Folder

The Noodlesoft forum is among the most active developer forums I have come across, and the Hazel user base is full of helpful and proactive people willing to chip in if you get stuck. The forum is also full of inventive Hazel actions that other users willingly share with newbies. Finally, if you are getting stuck and you are the kind of person who likes a visual guide, you can either checkout the innumerable videos on Youtube or David Sparks has a detailed [3] Video Field Guide available.

Downloads

Scale Images Automator Service

Combine PDF Images Automator Workflow

Starting with Text Expansion

This little gem from Brett Terpstra illustrates just one of the ways text expansion can be used. One of my as yet unstated goals with this blog is to hopefully lower the barrier for entry to some of the wonderful, simple automation tools available on the Mac. For anyone dipping their toes in the automation water for the first time, I will often suggest text-expansion as an ideal place to start. There are numerous utilities available for this, from apps like QuickKey, TypeIt4Me and Typinator to what is considered the gold standard in TextExpander.