iPad Diaries: Using a Mac from iOS, Part 1 – Finder Folders, Siri Shortcuts, and App Windows with Keyboard Maestro

After several years without updates to a product that, somewhat oddly, “remained in Apple’s lineup”, the Mac mini was revived by the company last November with a major redesign geared toward pro users and designed for flexibility. As listeners of Connected know, one of the show’s long-running jokes was that I would buy my last Mac ever as soon as Apple released a new Mac mini1; when it happened, I took the opportunity to completely rethink my home office with a new desk, well-specced Mac mini, and 4K display that supported both modern Macs and iPad Pros via USB-C.

Effectively, I had never owned a desktop Mac until2 this Mac mini arrived. I always preferred portable Macs to workstations, and over the years I moved from a late 2008 MacBook Pro to a 2011 MacBook Air and, in 2015, back to the (now Retina) MacBook Pro again. Over the past couple of years, however, and particularly since the introduction of iOS 11, my penchant for Mac laptops started clashing with the realization that the iPad Pro had become my de-facto laptop. I was using a MacBook Pro because I thought I needed a portable Mac machine just like when I started MacStories in 2009; in reality, the iPad had been chipping away at the MacBook’s core tasks for a while. Eventually, I saw how my MacBook Pro had become a computer I’d open twice a week to record podcasts, and nothing more.

With the iPad Pro as my primary computer, the Mac’s role in my life evolved into a fixed environment that was necessary for multi-track audio recording and Plex Media Server. And as I shared on Connected on several occasions, I realized that my workflow in 2018 wasn’t the same as 2009 anymore: it no longer made sense for me to have a Mac laptop when what I really needed was a small, but powerful and extensible Mac desktop. That’s why I started waiting for a new Mac mini, and my wishes were granted with the 2018 relaunch of the mighty desktop machine.

For the past three months, I’ve been busy setting up the Mac mini and optimizing it for the tasks that inspired its purchase. I bought external SSD drives (these two) to use for Plex and Time Machine backups; I set up a homebridge server to add unsupported accessories to HomeKit (such as our 2017 LG TV) and turn iTunes playlists into HomeKit scenes; I rethought my podcasting setup (I now have a Zoom H6 recorder and a taller microphone stand) and arranged my desk to make it easier to use the same UltraFine 4K display with the Mac mini and iPad Pro (I just need to plug in a different USB-C cable). Because this Mac mini is fast enough to handle 4K transcoding for Plex without breaking a sweat, I started using youtube-dl to enjoy 4K YouTube videos on iOS devices with the Infuse or Plex apps. I’m trying to take advantage of a powerful, always-on Mac server in any way I can, and I’m having lots of fun doing it.

This doesn’t change the fact that the iPad Pro is my main computer, and that I want to interact with macOS as little as possible. Aside from recording podcasts using Mac apps, I rely on the Mac mini as a server that performs tasks or provides media in the background. Any server requires a front-end interface to access and manage it; in my case, that meant finding apps, creating shortcuts, and setting up workflows on my iPad Pro to access, manage, and use the Mac mini from iOS without having to physically sit down in front of it.

In this multi-part series, I’m going to cover how I’m using the 2018 iPad Pro to access my Mac mini both locally and remotely, the apps I employ for file management, the custom shortcuts I set up to execute macOS commands from iOS and the HomePod, various automations I created via AppleScript and Keyboard Maestro, and more. Let’s dive in.

Get More iOS Productivity Tips and Shortcuts

With a Club MacStories subscription, you’ll gain access to weekly iOS shortcuts, app recommendations, and other exclusive extras.

Starting at $5/month, Club MacStories includes MacStories Weekly – a newsletter delivered every Friday with a focus on iOS productivity and showcasing new and interesting iOS apps. One of MacStories Weekly’s regular sections is the Workflow Corner – a weekly assortment of iPad shortcuts, iOS automation tips, and tutorials curated by Federico and the MacStories team.

As a new member, you’ll also receive complete access to our back catalogue of over 180 newsletters starting from September 2015.

You can find out more about Club MacStories here, or subscribe directly below.

[table_of_contents]

Accessing macOS Files from iOS: FileExplorer and the Files App

When Panic announced Transmit for iOS was going to be discontinued last year, I set out to find a suitable alternative for connecting to FTP servers on iOS, and I ended up choosing FileBrowser. While I initially approached FileBrowser because it offered native support for SanDisk’s iXpand USB-Lightning flash drive, I decided to start using the app full-time because, unlike Transmit and other similar apps, it embraced modern-day iOS with a file provider extension.

The ability to log into an FTP server or local macOS computer and export documents directly from the Files app (and any other app that integrated with Files) was the perfect example of the benefits provided by the system-wide Files framework. Although I remain convinced that Apple should offer built-in connectivity options in Files to support FTP/SFTP/WebDAV and other server types, FileBrowser was an acceptable solution that I used for months, despite some limitations.

As I noted in my initial coverage of FileBrowser, the app’s Files extension didn’t support logging into servers unless you launched the main FileBrowser app first and opened the connection from there. Between having to do this every time the iPad restarted or the FileBrowser app had been suspended in memory by iOS, the issue got annoying fast. But I didn’t know where else to look for an app that supported exposing servers to Files without requiring additional layers of authentication.

The authentication error in FileBrowser’s file provider.

Thankfully, MacStories reader Matthew brought FileExplorer to my attention last December; having used the app every day for over a month now, I can say this is my new gold standard for integration between Files and external servers.

FileExplorer shares more than a few similarities with other third-party file managers for iOS. Its icon and user interface aren’t what I would describe as “pretty” – the UI is functional at best, though it sometimes veers towards Android-ish traits (such as the odd contextual menu); the app comes with its own local storage space that can accept any kind of file passed by other apps; like Readdle’s Documents, FileExplorer offers its own photo viewer and built-in web server to receive files wirelessly from nearby devices (I never use these features); there’s even the ability to play music and videos inside the app. All of these options are now common among Files alternatives for iOS and they’re not the reason why you should pay attention to FileExplorer.

FileExplorer’s main app UI.

What sets FileExplorer apart is its excellent integration with the Files app, which, unlike FileBrowser, is fully independent from the main app and doesn’t require a separate authentication step. Connections you create in FileExplorer (and I tested this with FTP, SFTP, and macOS servers) show up as folders in the FileExplorer location in the Files app; even if the main FileExplorer app has been force quit, selecting a server inside its Files extension will open a connection in the background and display the contents of the connected server, allowing you to browse its file structure.

Browsing Mac folders in Files with no authentication errors.

Coming from FileBrowser’s constant authentication errors, FileExplorer’s reliable integration with the Files app is a game-changer: (S)FTP or SMB servers can be accessed from Files (and therefore any iOS document picker that uses Files, including Mail, Safari, or Slack) with just a couple of taps, as if they were a native feature of the Files app. Thanks to FileExplorer, any compatible server can become part of Files’ UI and integration with the rest of iOS, which includes functionalities such as drag and drop, multiple views and sorting options, asynchronous transfers, and the share sheet. Technically, this was possible with FileBrowser too; FileExplorer’s superior Files extension makes the whole experience faster and more pleasant to use.

I’ve been taking advantage of FileExplorer’s support for the Files app in a couple of ways. I set up multiple locations for different folders on my Mac mini such as Home, Downloads, Desktop, and the youtube-dl folder where I download YouTube videos offline. These are folders that I don’t sync with iCloud Drive or Dropbox and that contain files or sub-folders I still want to access from iOS.

To add multiple locations, I started from an initial macOS connection in FileExplorer and duplicated it multiple times, changing the initial path to different folders of my macOS user account.3 In the Files app, these connections appear as special folders with an ‘X’ logo in the FileExplorer location and I can tap on one to start browsing the contents of a folder on the Mac mini from my iPad Pro.

My local and remote connections in FileExplorer’s file provider extension.

In addition to local connections to the Mac mini, I also added SFTP servers to FileExplorer to connect to my web server as well as my Mac mini when I’m outside of my home network. The latter is based on a dynamic DNS service that gives me a unique domain (whose IP address is constantly updated by my ISP’s modem) that points to the mini’s internal address on the home network. This way, even when I’m not at home, I can SSH into the Mac mini4 and, say, grab a file from its Downloads folder without having to upload it to cloud services such as Dropbox first. Again, none of this is necessarily new to iOS power users, but the ability to do so from Files or a Files picker without authenticating inside another app first is unprecedented.

This is not to say that FileExplorer is perfect. As I noted above, the app isn’t the prettiest to look at and I’ve spotted a handful of typos throughout the UI. FileExplorer can’t sync connections across devices with iCloud5, doesn’t support Picture in Picture for video playback, and doesn’t integrate with the Open-in-Place API for files and directories yet. This means that, for now, you won’t be able to edit FileExplorer’s documents in-place inside other apps. There’s also an argument to be made about the fact that FileBrowser offers more contextual options for selected files, supports Siri shortcuts on iOS 12, and provides an overall nicer app experience than FileExplorer.

But that’s exactly the point: I don’t want to spend time in a third-party file manager because my iPad already has one that can be enhanced with extensions. Considered through the lens of Files integration, FileExplorer beats FileBrowser thanks to the speed and reliability of its Files provider, which requires no management once it’s been set up. With FileExplorer’s Files integration, my most-used Finder folders are always a couple of taps away, which has dramatically simplified how I can exchange files between the Mac mini and iPad Pro.

Mixed Automation: iOS Shortcuts for macOS Automation

Ever since I got the Mac mini, I was interested in exploring an idea I had long been putting off: blending iOS and macOS automation using Siri and the Shortcuts app.

For lack of a better name, I’m calling this mixed automation – which I’m going to use to indicate a series of techniques to trigger AppleScripts, Keyboard Maestro macros, shell commands, or even BetterTouchTool actions on the Mac by mixing them with actions and native iOS features via Shortcuts.

At a basic level, mixed automation consists of using the ‘Run Script Over SSH’ action of Shortcuts to send a command to a Mac on the same local network and execute an action included in the script itself. This method in itself is not new to Shortcuts (it was possible with Workflow before too) and, in the case of AppleScript, relies on the well-oiled machine that is the osascript command. However, I’ve been trying to expand this approach further by going beyond AppleScript alone and triggering Keyboard Maestro macros (which I find easier to put together than AppleScript); more importantly, I am trying to combine the automation possibilities of the Mac with iOS-only features of Shortcuts, such as the ability to activate these commands with Siri, present native UIs with dialogs and lists, or activate other native iOS app shortcuts in addition to sending commands to a Mac.

Mixed automation is a topic I plan to cover on a regular basis going forward here on MacStories as well as Club MacStories. For this reason, the shortcuts in this article are only an initial batch of the ones I’ve been working on; there’s lots more I’d like to share in the future and other solutions I want to test and explain when it comes to fusing Shortcuts and Mac automation.

That being said, allow me to detail some examples of shortcuts for macOS that I’ve been using for the past couple of months.

A Note on Mojave’s Privacy Controls

As part of Mojave’s revamped privacy controls, upon executing a shell command from Shortcuts via SSH you’ll be asked to grant a given process access to the macOS feature or app you want to control.

SSH is an example of a process started by Shortcuts that requires authorization on Mojave.

After granting access, you can review these permissions under System Preferences ⇾ Security & Privacy.

Wake Mac

This is the shortcut I’m using most frequently when I want to access my Mac mini from the iPad Pro. Built using the caffeinate command of the macOS shell (which sends a request to wake the computer from sleep), the shortcut wakes the Mac mini, bringing up the login screen.

This is all it takes to run a shell command on a Mac from Shortcuts.

Here’s why this shortcut is a good example of Apple’s seamless integration of different pieces of its ecosystem: because I’m wearing the Apple Watch and my apartment is small enough for the Mac to consider the Watch “nearby”, as soon as the shortcut has finished running I feel a series of taps on my wrist that tell me the Apple Watch has unlocked the Mac mini.

Of course, we can go even further and remove the need to run the shortcut from the Shortcuts app altogether. I assigned a “Wake my Mac” phrase to the shortcut, so I can now ask any permutation of Siri around the house (iOS, Watch, or HomePod) to wake my computer before I even walk into the office.6 “Wake my Mac” should be a native Shortcuts action, but caffeinate works well enough for now.

Wake Mac

Wake the display connected to a Mac on the same local network as your iOS device.

Get the shortcut here.

Wake Mac with Login

There are times when I need to log into my Mac mini but I’m either not wearing an Apple Watch or sitting too far from the mini for the proximity-based Watch unlock to work. Fortunately, there’s still a way for Shortcuts to call a script on macOS and log in by “typing” the user’s password; it’s not elegant, but it gets the job done.

By telling System Events to keystroke the Mac’s password as text, it’s possible to create a shortcut that wakes the Mac first (with caffeinate), waits a second, then pastes the password in the secure text input field that is selected by default when a Mac is awoken from sleep.

I don’t run this shortcut often (like I said, my apartment is small enough for the Apple Watch login to never fail, and I’m rarely without my Apple Watch), but it’s good to have the option if needed.

Wake Mac + Login

Wake the display connected to a Mac on the same local network as your iOS device and paste your password in the login screen by simulating keystrokes.

Get the shortcut here.

Sleep Mac

This shortcut is the exact opposite of Wake Mac and I use it whenever I don’t want to wait for the Mac mini to go to sleep on its own. Maybe I’m about to fall asleep and am bothered by the display’s light, or perhaps Silvia and I are watching a TV show and don’t want to see another light source in our field of vision. With this shortcut, I can instantly put the UltraFine display connected to the Mac mini to sleep.

Sleep Mac uses the pmset shell command with the displaysleepnow setting. The pmset command is used to modify and interact with power management settings of a macOS machine, and it supports a variety of options including network sleep, Power Nap, disk sleep, proximity wake, and more. In my case, I don’t want to put the entire computer to sleep – just its display. With this shortcut, the display is turned off immediately and, if activated via Siri and voice, I even get a response back saying “The Mac’s display is off”. It’s nice to be able to say “Hey Siri, sleep Mac” on iOS and see an instant result on another computer running a different OS.

Sleep Mac

Put the display connected to a Mac on the same local network as your iOS device to sleep.

Get the shortcut here.

Set Mac Clipboard

I, like others at the time, was not completely satisfied with Universal Clipboard when it launched as part of the Continuity initiative for Mac and iOS. For a long time, Universal Clipboard just straight up didn’t work or was too slow to paste the contents of another device’s clipboard; the feature was, at least for me, “fixed” at some point last year, and I would say it now works about 80% of the time, particularly if I’m copying and pasting between iOS devices. Still, there are occasions when Universal Clipboard just doesn’t want to sync the clipboard between platforms, and because I noticed the issue was more frequent when attempting to paste on the Mac something that had been previously copied on iOS, I decided to fix it myself with a shortcut.

At a high level, the shortcut works by chaining the printf and pbcopy shell commands so that the iOS clipboard is formatted as a string of text and “piped” to the Mac’s clipboard, ready to be pasted in any text field. As you can imagine, the shortcut takes advantage of the fact that Shortcuts comes with a native ‘Get Clipboard’ action that passes whatever has been copied on iOS as input for the next step.

Cleaning up the iOS clipboard before sending it to a Mac.

Before sending the iOS clipboard over to the Mac’s shell, however, the shortcut performs some cleanup tasks: line breaks are replaced by \n and both single and double quotes are escaped. Then, it’s just a matter of running a script over SSH with a pipe character (|), passing the output of the first command to the second one. Considering the manual Find/Replace that I do in the shortcut itself, the printf step is probably not even necessary, but I stole this approach from the excellent Mac Maestro shortcut launcher, and I prefer the additional check it involves.

Set Mac Clipboard

Set your Mac’s clipboard to the contents of the current iOS clipboard. The shortcut cleans up the iOS clipboard by escaping line breaks and quotes.

Get the shortcut here.

Check YouTube Formats

This is part of a longer story about how I’m using youtube-dl to download YouTube videos on the Mac mini and watch them in 4K on iOS (which I am going to write about at a later date), but I wanted to mention this shortcut because, despite its simplicity, it’s become one I run on an almost daily basis.

I have a whole setup (consisting of iCloud Drive, Hazel, shell scripts, Pushover, and Shortcuts) dedicated to converting YouTube links to audio or 4K video using my Mac mini. For those unaware of youtube-dl, it’s an amazing command line program that can download YouTube content in a variety of formats with support for dozens of custom settings and different scenarios (such as YouTube playlists). While the program can download the file behind a YouTube video and can do so automatically provided the right configuration flags, I prefer to use my own syntax to download – whenever possible – 4K videos in the WebM format with the highest frame rate available. However – and this is quite common for newly uploaded videos – 4K versions aren’t immediately available for download (or streaming) because YouTube is slow at processing high-quality formats. Which means I usually have to check if the format I want is actually available, otherwise I won’t bother with the download at all. For this reason, I had to write a shortcut to make it easy to check available video formats from iOS with two taps.

Checking the available formats for a YouTube link copied to the clipboard.

This is easy to do with youtube-dl thanks to its -F flag, which returns a plain text list of formats, resolutions, and file sizes for each version of a video available for download. My shortcut does the following: assuming there is a YouTube link in the system clipboard, the shortcut runs youtube-dl -F on the Mac mini via SSH and returns the output from the shell, which is cleaned up a little by adding the line breaks between each format. This takes about two seconds to run and it’s faster than any alternative I’ve tried on iOS (including running youtube-dl via iSH and Pythonista, but we’ll get into that in the future).

The result isn’t pretty, but it’s easy enough to scan the list for “2160p” or “2440p” entries once you get used to how the output is formatted. If the format I want is available, I’ll run another shortcut to start a download on the Mac mini, but I’m not covering that aspect today.

Check youtube-dl Formats

Use youtube-dl to check the available download formats for a YouTube link copied to the clipboard on iOS. The shortcut assumes youtube-dl has been installed on a local Mac under the /usr/local/bin folder.

Get the shortcut here.

iTunes Shortcuts

It may sound anachronistic in 2019, but one of the advantages of having a Mac mini always running and multiple HomePods around the house is iTunes. Yes, Apple’s music player/media manager gets a bad rap (and rightfully so; the app is a mess), but it’s got one thing going for it still: iTunes has extensive integration with AppleScript, including actions that can connect to AirPlay speakers and set their volume to play a specific song, album, or playlist. With iTunes, I can write AppleScripts that play Apple Music items from my library on specific HomePods/AirPlay 2 speakers; therefore, all these scripts can be triggered from Shortcuts on iOS and chained together in a multitude of interesting ways.

Play and Pause iTunes

This is an obvious one: I wanted a super-fast shortcut to instantly play or pause iTunes (which is usually sending audio to three HomePods at once) from either the Shortcuts widget on iOS or Siri. Thanks to osascript, this shortcut checks the player state of iTunes and either pauses it (if it’s already playing) or starts playing (if it’s paused).

Unlike Control Center on iOS, iTunes on the Mac always remembers the last AirPlay speakers it was connected to (even across restarts) as well as their individual volume levels. With this shortcut, I have a one-tap solution to resume iTunes’ playback on all the speakers it was previously connected to without having to manually select them each time. This is particularly nice when combined with the next shortcut.

Toggle iTunes

Toggle the player state of the iTunes app on a Mac on the same local network as your iOS device.

Get the shortcut here.

Play iTunes Playlist on Shuffle

Over the years, I’ve been curating a selection of playlists I like to listen to either by myself, with my girlfriend, or when we have friends over at our place. With AppleScript and iTunes, four lines of code are all it takes to start playing a specific playlist on shuffle:

tell application "iTunes"
set shuffle enabled to true
play playlist "Playlist Name"
end tell

In theory, I could have built a shortcut that played a specific playlists and duplicated it multiple times, changing the name of the playlist in each version. But that wouldn’t be a great use of what Shortcuts has to offer with its visual automation on iOS. Instead, my shortcut sends a Magic Variable to the AppleScript that runs on the Mac: a list of playlists is displayed by the ‘Choose from List’ action, and the chosen item is expanded as text upon running the AppleScript on macOS via the SSH action.

After picking a playlist from Shortcuts, you’ll be able to see the song playing on HomePod (via iTunes) from Control Center.

This approach allows me to have one shortcut in my library that lets me choose which playlists I want to shuffle with iTunes, which is going to resume playback with the last-selected speakers and volume levels – no need to pick them individually.

Play iTunes Playlist

Choose a playlist to start playing with iTunes on a Mac. The shortcut requires you to enter the exact name of playlists you want to play once, upon configuring the shortcut for the first time.

Get the shortcut here.

Once music starts playing on my HomePods, the last step of the shortcut is running another shortcut that returns details (including artwork) for the song that just started playing.

Current iTunes Song

The image part of this shortcut was adapted from Mac Maestro; the author of the shortcut figured out how to get raw data of the currently playing song’s artwork, which is returned as binary data to Shortcuts, which can feed it to ‘Get Images from Input’ to get the actual artwork from iTunes.

This shortcut lets you see the artwork of the song currently playing on iTunes on the Mac from the widget on iOS.

In addition to the artwork image, my shortcut returns the track name, artist, and album information from iTunes using a separate AppleScript. These bits of metadata are then set as the image’s title, which is presented in a ‘Choose from List’ action. This approach makes it possible to preview the artwork and track information both in the Shortcuts app and its widget, which is my preferred way of launching all these iTunes shortcuts.

iTunes Current Song

Get the album artwork of the song currently playing on iTunes on the Mac.

Get the shortcut here.

HomePod Speaker Volume

I love listening to music around the house with my three HomePods (one in the kitchen, one in the hallway, one in the bedroom), but I’ve often found myself wishing there was a quick way to change the global volume level without speaking to Siri. I mostly need to do this when my girlfriend and I listen to music at night before falling asleep. I don’t want to talk to Siri in the middle of the night and wake the dogs in the process.7 Similarly, when loud music is blasting through every room of the house during the day, I’d rather tweak the volume from the Shortcuts widget on my phone than have to a precise set of instructions to Siri. For me, tapping a widget is faster than saying “Hey Siri, set the volume to 45 in the kitchen and hallway”.

Ideally, Shortcuts should offer native AirPlay 2 actions to activate speakers and set their volume levels programmatically. In their absence, the solution once again lies in starting playback from iTunes on the Mac and using AppleScript.

How can something so trivial, so obvious in iTunes – by and large, the epitome of cruft in legacy software – be completely foreign to Shortcuts, the up-and-coming star of a new breed of automation? And yet here we are – while Shortcuts has no idea how to change the volume levels of connected AirPlay 2 devices, this AppleScript is all it takes iTunes to get it done in a second:

tell application "iTunes"
set sound volume of AirPlay device "Kitchen" to 10
set sound volume of AirPlay device "Hallway" to 20
set sound volume of AirPlay device "Nightstand" to 35
end tell

Sometimes cruft has its advantages.

The syntax is easy to comprehend: it literally says to set the volume of an AirPlay device with a specific name to a number between 0 and 100. The name of the AirPlay device is the name of the HomePod you can change in the Home app, which is reflected in iTunes’ AirPlay connection popup as well.

The names of the AirPlay speakers are the same ones used by iTunes on the Mac.

In this type of shortcut, multiple volume levels are changed at once by repeating the same command for different AirPlay devices. The numeric volume level is provided by a menu that fills a ‘Number’ action at the beginning of the shortcut, so I can choose to set my HomePods at 10, 15, 20, 25, 30, 40, or 60 percent volume with just a couple of taps.

HomePod Speaker Volume

Change the volume of multiple HomePods (or AirPlay speakers) connected to iTunes at once. The list of preset volume levels is customizable. The shortcut can also be run from the iOS widget.

Get the shortcut here.

Set Active HomePod Speakers and Volume

Sometimes I seek more control over my HomePods than a shortcut designed to tweak the volume alone can give me. Sometimes I want to choose which HomePods are the active speakers in iTunes and type out their exact volume levels. For that, I employ a different shortcut.

The ‘Set Speakers and Volume’ shortcut is comprised of two separate, yet entwined parts. First, I can choose which AirPlay devices to set as active speakers by selecting them from a list. The list carries the names of individual AirPlay devices, which are all selected by default. After choosing which HomePods I want to stream iTunes music to, an ‘Ask for Input’ action lets me enter a number for the volume level I want to set on the speakers. None of this is currently possible with Shortcuts alone on iOS.

Then, a repeat block takes care of assembling AppleScript code using ‘Text’ actions and Magic Variables until it prepares code that, behind the scenes, looks like this:

The script tells iTunes to change the speakers it’s currently connected to and, in the process, set their volume levels to a new percentage. Like the simpler volume shortcut above that inspired it, this one takes a second to run the command via SSH, but it’s got the added complexity of requiring user interaction to pick speakers and type numbers.

Selecting active iTunes speakers from Shortcuts is instantly reflected in Control Center’s AirPlay widget.

The shortcut works well and I wish this kind of control over AirPlay devices was supported in Shortcuts too. I’d love to be able to create shortcuts that play music on specific HomePods over AirPlay 2 with a specific volume and no manual interaction required whatsoever. As I wrote when Shortcuts launched in September, I continue to be astounded by its lack of AirPlay 2 actions.

Set Active Speakers and Volume

Change the volume of individual HomePods (or AirPlay speakers) connected to iTunes and choose which ones should be currently active. The shortcut lets you select one or multiple speakers as well as enter an exact volume level.

Get the shortcut here.

Preparing for Podcasts with Keyboard Maestro

For years, I sat down at my desk to record podcasts and went through the process of opening each app I needed for the recording, carefully arranging its windows, and typing URLs to open specific documents and webpages I needed in Safari. I checked audio inputs and manually started a new audio recording in QuickTime. I started my Toggl timer if I remembered to and changed the lights in the bedroom to a specific color, dimming them so I could focus on the show notes in front of me. I didn’t have multiple displays then. You see, I recognize that I’m a little particular when it comes to my podcasting setup: I like things my way even though I profoundly despise the act of resizing and moving windows on a Mac. Yet I need this to quell the part of my brain that laments an ever so imperfect setup should I record with a slightly off-center Safari window. It’s probably a silly problem to have, but it’s my problem.

As soon as I got a Mac mini, a larger monitor, and the iPad Pro running next to it thanks to Luna Display, I knew it was time to automate the entire thing. I knew it couldn’t be done with Shortcuts and AppleScript alone, so I turned my attention to two old friends of my former Mac OS X days – Keyboard Maestro and BetterTouchTool.

The result is this setup, ready for me to record a podcast, which only takes a single Siri phrase to spring to life:

Lights dimmed, a shade of purple, and lots of app windows – this is how I like my podcasts.

And here’s a quick video version of it:

Setting up a Mac for podcasting via Shortcuts. (Tap volume icon for sound.)

Of course, I still need to physically place the microphone on my desk. But you get the idea.

This automation involves different parts: on iOS, Siri activates a shortcut that triggers a Keyboard Maestro macro on the Mac; Keyboard Maestro opens URLs, creates windows and repositions them, and calls for BetterTouchTool to move them to the Luna Display monitor; then it’s back to iOS again, with Shortcuts starting a specific Toggl timer and setting the lights a certain shade of purple. It’s a beautiful intricacy of mixed automation, and I’ve been using it for the past month to great effect. Let me describe how it all works.

Before I sit down to record a podcast, I invoke a shortcut on my HomePod. The shortcut looks surprisingly sparse:

In reality, it’s anything but.

The first step of the shortcut is a ‘Run Script Over SSH’ action that tells my Mac to run a specific Keyboard Maestro macro aptly called “Podcast Time”. This is possible thanks to Keyboard Maestro’s AppleScript dictionary, which lets you control the app from other places on macOS and, in this case, iOS via osascript. Automations to run other automations – a common theme in what I’m about to describe.

The Podcast Time macro is where most of the action takes place. A screenshot wouldn’t do it justice, so let me go through the broad strokes of this cornucopia of actions. The macro starts by launching Safari and resizing its frontmost window so that it occupies two thirds of my UltraFine display. Another action selects the first tab that I always keep pinned in Safari for Google Docs. This is where the document for the episode’s show notes will be open, allowing me to have plenty of room to look at the outline without much scrolling. Keyboard Maestro then opens a new Safari window and, if I’m recording a Relay show that involves a live chat, points it to relay.fm/live.8 The window is then resized to be a narrow rectangle that fills half of the remaining third of the display. I calculated these dimensions by testing several different combinations until I got the layout I wanted and the window width that worked best for me.

Opening and resizing windows with Keyboard Maestro.

After opening and placing Safari windows on screen, the macro turns to other apps I typically keep open while recording podcasts. If the show is being streamed live on the Relay website, I open Tweetbot and put it on the rightmost side of the screen so I can keep an eye on additional real-time follow-up from listeners. Note how, throughout the macro, I dispersed an array of ‘Pause Until Conditions Are Met’ actions to make sure that apps can fully activate and come to the foreground before invoking actions that control them. It’s easy for Keyboard Maestro to get ahead of itself and attempt to, say, select a menu in an app that isn’t visible yet.

In five seconds, the main UltraFine display is filled with windows and I don’t have to lift a single finger. Apps are launched, tabs are selected, their windows resized and all I did was utter a command to Siri on a device that isn’t even a Mac. But the best part of the macro has just begun.

The final result on the UltraFine display.

Now that the UltraFine is plastered with windows, I want other apps to launch and their windows to be automatically shuffled to the display next to the UltraFine – the iPad Pro running Luna Display. This is where BetterTouchTool comes in.

Other audio apps opened on the Luna Display.

To the best of my knowledge, Keyboard Maestro doesn’t offer any actions to interact with connected monitors and the app windows displayed on them. BetterTouchTool (also known as BTT), with its myriad of options to rewrite the behavior of keyboard shortcuts, trackpad gestures, and more, does.9 So I decided to put together some BTT actions (grouped together) to launch, move, and resize windows that need to go on the iPad’s display.

Let’s use Audio Hijack as an example. First, BTT launches the app; then, thanks to the ‘Move Windows to Next Monitor’ action, the window is flung to whatever monitor is sitting next to the UltraFine (which is my primary display).

My action groups in BetterTouchTool.

At this point, a third linked action in this group uses the ‘Move/Resize’ action of BTT with a series of custom parameters. Here’s what it looks like:

How I resize windows on the Luna Display with BTT.

In plain English, this action takes the active window (Audio Hijack in this case) and resizes it to specific dimensions on the monitor that is sitting left from the display where the mouse cursor is. This is an additional check to make sure that the Audio Hijack window stays on the Luna Display and is resized there without being transported back to the UltraFine. The size and placement of the window was, once again, optimized by me through trial and error based on personal taste.

This cluster of actions linked together by BTT in a single flow – launch app, move it, resize it – is repeated for the three apps I use to converse and record audio: Skype, QuickTime, and Audio Hijack. The only difference between them are the values used to position their windows on the iPad’s display.

Once I had the actions to move and resize windows set up in BTT, I had to figure out a way to trigger them from the Keyboard Maestro macro. Thankfully, the developers of BTT thought about this possibility as well: BTT actions can be triggered from external apps in a variety of ways, one of them being an AppleScript that runs a specific action by calling its unique ID. The AppleScript looks like this:

tell application "BetterTouchTool"
execute_assigned_actions_for_trigger "CFDA72F8-E2DD-4F0D-93B3-A424895R5BBD"
end tell

The UUID of a BTT action can be retrieved by right-clicking on an action and selecting the ‘Copy UUID’ option from the contextual menu. In an action group, running the first action from the top will automatically continue executing subsequent ones.

You can guess what I did next. I created three separate AppleScript files for the three aforementioned audio apps, saved them in the /Scripts folder of my Mac, and used the ‘Execute AppleScript’ action of Keyboard Maestro to run them from my macro.

Because BetterTouchTool expects each app to be already opened (how can you move windows if there are no windows to begin with?), I first had to make sure each app was opened and in the foreground before invoking the BTT scripts. Here’s what this looks like in Keyboard Maestro for Audio Hijack and Skype:

Triggering BTT actions from Keyboard Maestro.

The only exception is QuickTime player, for which I also need to create a new audio recording by selecting File ⇾ New Audio Recording. But, of course, I don’t really need to select this menu item myself – Keyboard Maestro can do it for me with one of its inbuilt actions. So after launching QuickTime player but before running the AppleScript that tells BTT to move it across displays, this single step in Keyboard Maestro selects the menu item I need and prepares a window for a new audio recording:

Now, all the apps I need for recording a podcast have been launched, their windows resized and hurled through displays. Less than 15 seconds have passed since I asked Siri to prepare my Mac for podcasting, and the Keyboard Maestro macro is done. I might as well sit down and do the actual thing. Or at least you’d think so.

Back on iOS, there are two more steps the shortcut needs to finish running. First, I want my desk lights to be purple because I like that color when I’m talking to my friends on Skype. Don’t ask why. This is easily done with the ‘Run Home Scene’ action in Shortcuts, which runs my ‘Purple Bedroom’ scene that I set up months ago in the Home app.

Finally, the shortcut has to start a Toggl timer specific to the podcast I’m about to record. This is where the last step of all this, the ingeniously-named ‘Record Podcast’ shortcut, comes in to finish everything off.

This shortcut was built for my personal needs, but it’s easily adaptable to anyone who deals with recurring events and wants to start a timer when they’re about to start. The Record Podcast shortcut starts a Toggl timer if an event in my calendar matches one of the multiple podcast names I set up. If my Podcasts calendar has ‘Record Connected’ in it at 7 PM, the shortcut will start a ‘Recording Connected’ timer when I run it; if ‘Record AppStories with John’ is found, a Toggl timer for AppStories will start instead. And so forth. It’s a simple solution that I integrated with the automations I use to prepare my Mac for podcasts so that I never forget to track the time I spend recording them.

My shortcut to start Toggl timers for specific calendar events.

Given a list of event names (could be podcasts, could be meetings, could be soccer practice – anything that is recurring on your calendar works), the shortcut scans the iOS Calendar for events whose start date is between the past and next hour. This way, the shortcut will find events whether I run it before the event begins or if I’m late. Then, a regular expression matches the event found in the calendar (if any) against my list of podcast names; if there is a match, it means a podcast session is about to begin. A block of ‘If’ actions uses a different Siri shortcut to start a Toggl timer in the background depending on which podcast is found. The app I’m using to prepare these Toggl shortcuts is called Timery and is currently in beta (and I can’t wait to write about it), but you can replicate the same setup by using the Siri shortcuts donated by the official Toggl app for iOS.

When I run the shortcut on my iPhone, nothing else is shown besides the Toggl shortcut started at the end.

Start Timer for Event

Start a Toggl timer (with the Timery app) based on an event name found in a specific calendar (or multiple calendars). You have to specify the event name in a list and replace the Siri shortcuts for Timery if you don’t have the app installed.

Get the shortcut here.

Dozens of actions, 20 seconds, and zero manual interactions after I told Siri that it’s “recording time”, the shortcut is complete at last. Mac apps are ready and waiting for me in their dual-screen setup; my lights are just the shade of purple I like; and a timer is ticking on Toggl. For years, I did all of this manually, and it took me several minutes to carefully position windows – when I had the patience to do so. Most of the time I just left a jungle of windows sprawling across the screen and forgot to track my time.

I love this new system I’ve put together. It has never failed me over the past couple of months – a testament to the Mac’s dependability as much as a validation of macOS’ greatest advantage compared to iOS: the absolute freedom to tinker, modify, and mold a computer to one’s needs. I prefer using the iPad Pro as my computer for everything else, but I still have to use a Mac and Mac software for podcasting. Who’s to say I can’t combine the best aspects of automation on both platforms to make the entire process better suited for me?

Coming Next…

There is much left to explore in this new approach to accessing and controlling a Mac from iOS, and I’m still figuring out new ways to take advantage of my Mac mini. In this article, I’ve only detailed how to access the Finder from Files, shared a handful of shortcuts, and described my advanced macro to prepare a Mac for podcast recording.

I’m not done yet. I have more BetterTouchTool and Luna Display tips to share. I need to explain my different uses of VNC and Luna Display from the iPad Pro. There are more shortcuts, more Keyboard Maestro macros to examine. As I promised, I’ll have to write about youtube-dl and homebridge, for which I’m glad I decided to abandon Mac laptops and get an always-on Mac mini server instead. And then I’ll have to explain how I built my own command panel with shortcuts that simplify using a Mac from an iPad Pro:

But that’s a story for another time. It’s going to be a fun ride.

It was funny because everybody thought the Mac mini line was done. ↩

Many years ago, I did use an iMac for a few months. However, I never considered that machine truly mine – it was set up at my parents' house (where it now sits unused) and I worked on it for a while until I moved in with my girlfriend a few months later. ↩

When creating a macOS connection in FileBrowser, you can include a hidden folder in the 'Path' field by prefixing it with a period (this is what I do with my .homebridge folder, which is otherwise hidden in the Finder). There's also a toggle to show hidden files on a per-connection basis. ↩

FileExplorer supports key-based authentication alongside username and password. ↩

Though you can save and export a configuration file and re-import it on a different device, which gets the job done. ↩

A fancier term to indicate a dedicated corner of our bedroom. Please let me have this one. ↩

Zelda and Ginger can sleep through music, but they'll awaken instantly if I talk to Siri. Part of me wonders if they learned how to respond to "Hey Siri" more accurately than the HomePod itself does. ↩

I have multiple versions of the same macro that account for Relay shows with and without live chats as well as AppStories. ↩

This app can do so much more, it's beyond the scope of this story, but stay tuned for more BetterTouchTool coverage on MacStories in the future. ↩