Using a Mac from iOS, Part 2 – Luna Display and macOS as an App

Luna Display as a Secondary Display: Keyboard Shortcuts

As a first order of business, I realized I needed to change some of the keyboard shortcuts that were in conflict between macOS and iOS.

Despite the fact that it creates the illusion that you’re using macOS on an iPad, it’s important to remember that Luna Display is still an iPad app, and as such it responds to default keyboard shortcuts that are shared system-wide across all apps on iOS. Specifically, when I started using Luna Display, the keyboard shortcuts to activate Spotlight search and the app switcher (⌘Space and ⌘Tab, respectively) kept triggering those functionalities on the iPad rather than being passed over to macOS. I had to replace them if I wanted to use the Mac’s search feature and app switcher from Luna Display on the iPad.

Disabling Spotlight was easy. To do this, go to System Preferences ⇾ Spotlight ⇾ Keyboard Shortcuts and disable ‘Show Spotlight Search’. If you want to keep using Spotlight but simply change its keyboard shortcut, click on it and record a new one from the keyboard. I’ve always preferred Alfred to Spotlight, so I turned off Spotlight’s keyboard shortcuts completely and started using ⌥Space to trigger Alfred’s search window, which does not conflict with iOS’ ⌘Space shortcut. It took a while to get used to opening search on the Mac with this new hotkey after years of ⌘Space, but the trade-off has been worth it. I can now use both iOS search and Alfred from Luna Display on the iPad – which is nice when I want to put an iOS app on top of Luna Display in Slide Over mode.

Replacing the ⌘Tab app switcher was trickier. As far as I know, there is no way to remap the default keyboard shortcut for the app switcher on macOS that doesn’t involve installing system modifications I’m not comfortable with. So I went in a different direction and settled on a third-party app switcher that mimics the default Apple one but extends it with some additional options, including customizations for its appearance and keyboard shortcut. The app is called Command-Tab Plus, and it looks like this after my customizations:

A custom app switcher that does not interfere with iOS' built-in one.

A custom app switcher that does not interfere with iOS’ built-in one.

In terms of preferences, as you can see below, there are plenty of options you can configure to filter which apps are going to be shown in the custom switcher and what the palette looks like. I appreciate how I can hit numbers to quickly select specific apps and how I can cycle backwards in the list of apps by holding down the ⇧ key, just like with the Apple switcher.

Effectively, at this point I have two separate app switchers on my Mac mini – the default one and Command-Tab Plus. This way, when I access the Mac from Luna Display on the iPad I’m free to use either the iOS app switcher5 or the Mac one. Once again, it took me a few days to get accustomed to using ⌥Tab after years of muscle memory with a different keyboard shortcut, but I prefer the extra versatility granted by Command-Tab Plus now.

Controlling Windows with BetterTouchTool

To the best of my knowledge, by default macOS does not provide any keyboard shortcuts to cycle an app window through multiple displays, which, as I’ve noted in this article, is the most annoying limitation of using Luna Display as a secondary display for your Mac. To fix this problem, I’ve turned to BetterTouchTool.

It’s nearly impossible to sum up what BetterTouchTool can do in a single paragraph, but I’ll try: with BetterTouchTool, you can associate almost any action on your Mac with a custom keyboard shortcut, gesture, mouse click, or Touch Bar button. Whether you need to launch apps, trigger a specific menu item of an app, control windows, or run AppleScripts, BetterTouchTool can do it. It’s like Keyboard Maestro, but with a simplified interface that’s designed to let you quickly program your own shortcuts. If you’re interested in this kind of utility, take your time to read through the documentation and play around with a few examples; invest enough time into learning BetterTouchTool and what it can accomplish, and you’ll end up with a highly personalized macOS environment that can save you several minutes every day.

In my case, all I had to do to make it easier to fling app windows across displays was use BetterTouchTool’s ‘Move Window to Next Monitor’ action. As shown below, all it takes is creating a new shortcut in the ‘Keyboard’ category of the app, giving it a hotkey, and picking the action from a list of predefined steps:

Now, whenever I want to move a window that has opened on the primary display (the UltraFine) to the Luna Display, I just need to press ⌃⌘L and the window will instantly move. But that’s not all: if I’m working with two displays at once (for instance, when I’m recording podcasts), I can hit the same shortcut to shuffle the current window back to the primary display because BetterTouchTool’s action is designed to move windows to the “next” monitor, so it’s not specific to the Luna Display one.

There are other BetterTouchTool actions I set up to improve the experience of using macOS from the iPad Pro. I was finding it difficult to maximize the size of app windows due to the small size of window resizing controls (because macOS is not optimized for touch interactions), so I assigned the ‘Doubleclick Window Titlebar’ trigger to ‘Maximize Window’.

Thanks to this gesture shortcut, when I’m using Luna Display and want to resize windows to fill the iPad Pro’s screen, all I need to do is double-tap their title bar and they’ll expand to all four corners of the display.

I also created a BetterTouchTool shortcut to resize windows so they can fill the screen until they reach the edge of the dock on the right side of the screen and the custom Accessibility panel at the bottom. To do this, I assigned a hotkey to ‘Custom Move/Resize Window’ and configured the action’s parameters as follows:

Essentially, this configuration tells BetterTouchTool to start resizing a window from the top-left corner of the display and fill the remaining space on the right by taking into consideration both the dock and menu bar. In terms of height, I set BetterTouchTool to give it an absolute value of 880px, which I manually calculated (with trial and error) to account for the presence of the Accessibility panel. Here’s an annotated version of the configuration screen that highlights the options I just mentioned:

I’ve barely scratched the surface of what BetterTouchTool can do, but I believe its support for multiple displays and window control actions is perfectly suited for Luna Display users who want a better way to deal with windows across multiple displays.

Custom Accessibility Keyboard Panel

Lastly, I want to explain how I’ve been taking advantage of macOS’ built-in Accessibility Keyboard feature and how I’ve turned it into a custom shortcut panel to trigger various features of macOS more comfortably both from the iPad Pro and when I’m working on my Mac mini.

Among the several Accessibility features supported by macOS, Apple offers a customizable Accessibility Keyboard that lets you use a Mac without a physical keyboard. For users with physical impairments, this is an essential functionality that allows them to type and use apps without having to interact with a physical keyboard. By default, the Accessibility Keyboard looks like a standard QWERTY onscreen keyboard; however, you can fully customize its appearance, as well as create new virtual keyboards from scratch, by using the built-in Panel Editor app available for free on macOS.

The Accessibility Keyboard is based on the idea of panels, and users can create multiple panels with buttons that perform specific actions such as launching apps, triggering system functions, or running AppleScripts. You can create as many panels as you want, and you have complete control over the appearance of buttons and their layout. In addition to the Apple documentation I linked above, I recommend checking out this article from AbilityNet about Panel Editor.

The Accessibility Keyboard and its custom panels are typically employed by visually or physically impaired users who want to have a more comfortable way of interacting with certain macOS features, which is a beautiful idea that confirms how Apple is at the forefront of Accessibility among all tech companies. But I had a different idea: what if I could use custom panels to create a “keyboard” that was actually a shortcut launcher for various apps and AppleScripts that I frequently invoke on my Mac?

I came up with this approach because I realized that, when using macOS via Luna Display on the iPad Pro, I wanted to have something that would allow me to visually launch specific commands in the fastest way possible. I’ve always been terrible at remembering long lists of keyboard shortcuts; instead, I wondered if I could have a “command palette”, sort of like Launch Center Pro but for the Mac, which would let me quickly execute actions with a single tap. Not only did I come up with a system that works well on the iPad because buttons are large enough to be tapped, but in the past few months I’ve also gotten used to this tool when I’m working at the Mac mini.

The final result looks like this:

And here is what it looks like when it’s being configured in Panel Editor:

The Panel Editor.

The Panel Editor.

As you can see, each button (I used emoji to make it more visually pleasant) is associated with an action that I frequently perform on the Mac. To modify the appearance of a button and the action linked to it, there is an inspector on the right side of Panel Editor. Here, in addition to font size and color, you can choose the type of action a button should perform from a list of:

  • Go Back
  • Open Panel
  • Show / Hide Toolbar
  • Dwell
  • AppleScript
  • Enter Text
  • Press Keys
  • Open App
  • System Event
  • Typing Suggestions
Built-in actions that can be assigned to buttons from Panel Editor.

Built-in actions that can be assigned to buttons from Panel Editor.

As I mentioned above, most of my buttons are based on the AppleScript action and scripts I’ve saved in the /Scripts folder of the Mac’s Finder. Of course, when a button triggers an AppleScript, the script runs in the background, so you never see any AppleScript code onscreen.

The ‘Toggle iTunes’ button, as the name suggests, toggles the playback state of iTunes. This is nice because, as I noted previously, iTunes is the only music app made by Apple that supports AirPlay automation for multiple HomePods. The button is based on the following script:

tell application "iTunes"
    if player state is paused then
        play
    else if player state is playing then
        pause
    else
        play
    end if
end tell

The ‘Mute’ button is another shortcut to quickly mute/unmute system audio on the Mac mini, and it is a built-in action of Panel Editor:

The ‘Downloads’ and ‘iCloud Drive’ buttons open those folders in a new Finder window with one tap6, so I don’t have to navigate the file system to get there:

tell application "Finder" to open "Macintosh HD:Users:viticci:Downloads"
set userLibraryFolder to path to library folder from user domain
tell application "Finder"
    reopen
    activate
    set iCloudDriveFolder to folder "iCloud Drive" of folder "Mobile Documents" of userLibraryFolder
    set target of Finder window 1 to iCloudDriveFolder
end tell

The ‘Slack’ button is based on the ‘Open App’ action and it, well, launches the Slack app.

With ‘Homebridge’, I came up with a simple way to restart my homebridge server whenever my Mac mini reboots or if I just want to start up the HomeKit server again. It’s also based on an AppleScript:

tell application "Terminal"
    activate
    delay 2
    set shell to do script "homebridge"
end tell

The ‘Hide Luna’ and ‘Dock’ buttons toggle the visibility of the Luna Display popup (seriously, it’s always in the way), and the macOS dock.

tell application "System Events"
    if visible of process "Luna Display" is false then
        tell application "Luna Display" to activate
    else if visible of process "Luna Display" is true then
        tell application "Finder" to set visible of process "Luna Display" to false
    end if
end tell
tell application "System Events"
    tell dock preferences to set autohide to not autohide
end tell

And finally, the ‘MacStories’ button launches the MacStories website in a new Safari tab.

tell application "Safari"
    tell window 1
        set current tab to (make new tab with properties {URL:"https://www.macstories.net"})
    end tell
end tell

I was pretty happy with this setup, but I knew I also wanted to come up with a way to enable and disable the Accessibility keyboard by pressing a single hotkey.7 Unfortunately, the macOS AppleScript dictionary does not have native support for activating the Accessibility Keyboard, so I had to turn to the inelegant, unreliable, but sometimes effective world of GUI scripting. This means I had to write AppleScripts that simulate clicking elements in the macOS UI without having to do it myself; effectively, I’m letting a script “interact” with the interface in a programmatic fashion to save a bit of time.

In practice, the final product looks like this:

Replay

These two hotkeys are based on AppleScripts that contain a bunch of ugly, flimsy GUI scripting code to open System Preferences, select the Accessibility tab, scroll down to the Keyboard section, and toggle the state of the Accessibility Keyboard setting so I don’t have to do all this myself manually every time. Here’s the code8 to enable the Accessibility Keyboard:

tell application "System Preferences"
    reveal pane id "com.apple.preference.universalaccess"
    delay 1
    tell application "System Events"
        tell window 1 of application process "System Preferences"
            select table 1 of scroll area 1
            delay 0.1
            select row 16 of table 1 of scroll area 1
            delay 0.1
        end tell
        tell tab group 1 of group 1 of window 1 of application process "System Preferences"
            click radio button 2
            delay 0.1
            click checkbox 1
            delay 0.2
        end tell
    end tell
    quit
end tell

And here’s the AppleScript to disable it:

tell application "System Preferences"
    activate
    reveal pane id "com.apple.preference.universalaccess"
    delay 1
    tell application "System Events"
        tell window 1 of application process "System Preferences"
            select table 1 of scroll area 1
            delay 0.1
            select row 16 of table 1 of scroll area 1
            delay 0.1
        end tell
        tell tab group 1 of group 1 of window 1 of application process "System Preferences"
            click radio button 2
            delay 0.1
            click checkbox 1
            delay 1
        end tell
        tell window 1 of application process "System Preferences"
            click button 1 of sheet 1
        end tell
    end tell
    quit
end tell

I’m not happy with the GUI scripting approach, of course: unlike native AppleScript, it’s tied to the interface, therefore if Apple changes even a subtle element of a window or menu in a macOS update, these scripts are going to break. However, both scripts get the job done and are reasonably fast. Even better, researching all this led me to discover UI Browser for Mac, an amazing utility that lets you inspect any visual element of the Aqua GUI, browse the hierarchy of windows and menus, and see what their AppleScript representation should be written like.

This is how I navigated the structure of System Preferences for GUI scripting. (Tap for full-size image.)

This is how I navigated the structure of System Preferences for GUI scripting. (Tap for full-size image.)

As you might imagine, I went down the rabbit hole with all of this for a few weeks, but I’m happy with the final result. The scripts to toggle the Accessibility Keyboard panel work great, and I’ve learned a few things about GUI scripting that might come in handy down the road. If you want to automate a Mac app that doesn’t natively support AppleScript, I highly recommend giving UI Browser a try to see what you can come up with.

The “shortcuts bar” that I created using the Accessibility Keyboard for macOS has quickly become one of my favorite enhancements to the everyday Mac experience whether I’m using macOS from the Mac mini or the iPad Pro via Luna Display. It’s a testament to Apple’s commitment to automation and the Mac’s greatest advantage over iOS – the complete freedom to personalize the operating system and truly make it your own.

Finally, here is a short video showing how I can use Luna Display as a secondary display for the Mac mini (which is in another room) while taking advantage of keyboard shortcuts and the Accessibility Keyboard panel:

Using Luna Display as a secondary display with the help of BetterTouchTool. (Tap volume icon for sounds.)Replay

Luna Display

The idea of using “macOS as an app” seemed ridiculous to me when I first heard of Luna Display years ago, but now that it’s become part of my workflow and daily routine, it feels obvious. Even though macOS was not designed for multitouch and using it from an iPad will never be a substitute for the real experience of using a Mac, Luna Display is the closest I was able to get to owning a hybrid Apple device that “runs” both iOS and macOS. Despite the occasional slowdowns or latency issues, the illusion created by Luna Display – this idea that you can have two OSes in one Apple device – is so strong, it feels like a natural complement to the iPad Pro.

Perhaps someday we’ll have an Apple laptop running a future operating system that blends the best of both worlds – the sheer ingenuity of iOS and its vibrant app ecosystem, and the wisdom, deep personalization, and technical prowess of macOS. I, for one, cannot wait for that future to become our new reality. But until that happens, Luna Display is the best workaround I’ve found to date, and it’s one of my favorite tech purchases of the past few years.


  1. When you switch between iOS apps with Luna Display running, the connection to the Mac is usually kept alive for a few minutes. I can switch back and forth between, say, Shortcuts and Luna Display without issues. 
  2. I adapted the iCloud Drive script from this one
  3. If you're on a Mac, you can also enable an Accessibility Keyboard setting that lets you "dwell" on a hot corner to toggle the visibility of a panel. I use this option when I'm at my Mac mini, but the Luna Display doesn't have a cursor, therefore I can't hover over a corner of the screen to quickly toggle the Accessibility Keyboard. 
  4. The basic template for these scripts was likely taken from StackOverflow, but I don't remember the original source, and I also ended up modifying them a lot for the latest release of Mojave. 

AppStories, Episode 106 – The Apps of Apple’s March 25 Services Event

On this week’s episode of AppStories, we take a close look at the apps and services announced by Apple at its March 25th services event at the Steve Jobs Theater in Cupertino including the TV app, News, Apple Arcade, and Apple Card.

Sponsored by:

  • Luna Display: The only hardware solution that turns your iPad into a wireless display for your Mac. Use promo code APPSTORIES at checkout for 10% off.
  • ExpressVPN: High-Speed, Secure & Anonymous VPN Service. Get 3 months free with a 1-year package.

AppStories+ Deeper into the world of apps

AppStories Episode 106 - The Apps of Apple’s March 25 Services Event

0:00
36:35

AppStories+ Deeper into the world of apps

Permalink


HoudahSpot 5 Review: Advanced File Search and Filtering on the Mac

There’s a lot of power lurking under the hood of the Mac’s Spotlight search index, but that’s also the trouble. To make Spotlight accessible to more users, many of the feature’s most useful tools are hidden behind menus and special search syntax.

HoudahSpot takes a different approach that makes it easier to access the power of Spotlight. The app surfaces Spotlight’s advanced file search functionality and couples it with its own layer of tools to extend what Spotlight can do. With version 5, the app has been reexamined from top to bottom adding new features and refining the entire experience. The result is a terrific update that maintains HoudahSpot’s position as one of the premier pro utilities on the Mac.

Read more


Arq: Trustworthy Backup [Sponsor]

Backups of your computer’s files have to be trustworthy. If you can’t trust your backups, they’re not really backups.

The reason Stefan created Arq Backup for the Mac back in 2009 was because he couldn’t find an online solution that felt like real backup. Most online backup providers were and continue to be vague about where the data are stored, how durable the storage is, and how sustainable the business model is.

Arq does everything it can to provide a completely trustworthy backup solution.

Why should you trust Arq?

  • Arq is open. It stores versioned, de-duplicated backup records in a format that’s documented.
  • Arq is private. Backup records are encrypted with a password that only you know. The password never leaves your computer, and your data is encrypted before ever leaving your computer.
  • Arq gives you control. Your backup data is stored in your own cloud account, SFTP server, or NAS.
  • Arq verifies. Arq periodically makes sure the contents of the objects at the destination match the contents of your files on disk.
  • Arq notifies. You’ll get a notification when there’s an error.

Do you like having total control over your data? Do you want to maintain your privacy? Then Arq is for you!

Download a free 30-day trial of Arq today and rest easy knowing that your files are backed up and secure.

Our thanks to Arq for sponsoring MacStories this week.



Castro Launches Top Picks Feature for Intelligent Episode Recommendations

In an update arriving today, Castro is introducing a new Top Picks feature designed to make managing a large number of podcast subscriptions easier than ever.

One of Castro’s most defining traits is its triage system: the app by default stores new episodes of shows you’re subscribed to in a New section, not in your playback queue, and inside New you can send the episodes you care about to your queue, while archiving anything that doesn’t interest you. If you subscribe to a wide array of shows, Castro’s New section is great; however, one drawback is that it previously lacked any sort of priority or hierarchy. Though Castro offers the option of having certain shows go straight to your queue, that requires manual configuration, and it’s really only ideal for shows that you want to listen to every single episode of. In most cases, the majority of shows will land in New, and Castro previously had no way of knowing which of those episodes you were more likely to care about. That’s why Top Picks was created.

Top Picks is an addition to the New tab which highlights episodes from your subscriptions that Castro thinks you’ll want to listen to. You can still access your full subscription roster at any time, but Top Picks will serve as a curated subset of episodes that’s easier to sort through.

Shows are surfaced in Top Picks based on your listening history, which the app analyzes on-device using only local data, so it remains private. If you’re new to Castro, this means it may take a little time to get the best Top Picks suggestions, but the good news is that training the system merely requires listening to the shows you care about. As you make decisions about what to listen to, Castro learns from those choices and uses that data to inform what does and doesn’t get sent to Top Picks.

If you only listen to a handful of podcasts, Top Picks likely isn’t for you because it addresses a problem you don’t have. But for users whose subscriptions can be a lot to keep up with, the feature simplifies the act of triage and, in the process, makes Castro an even better tool for enjoying the ever-growing world of podcasts.


BBEdit Returns to the Mac App Store After 4+ Year Absence

Beginning today, BBEdit 12 is available for download through the Mac App Store. BBEdit was previously listed for purchase through the Mac App Store, but famously left the store in October 2014. Last year, however, Apple announced on-stage at WWDC that BBEdit would be returning to the new Mac App Store in the near future, and that day has finally arrived. From the developers’ press release:

“We are delighted to be offering BBEdit in the Mac App Store again,” said Rich Siegel, founder and CEO of Bare Bones Software, Inc. “Since the release of macOS Mojave, the Mac App Store provides a beautiful new look; unique editorial content; and an emphasis on human curation, while offering a trusted and secure source for macOS software. In addition, the new Mac App Store makes it possible for us to offer our customers the option of a subscription-based pricing model.”

BBEdit 12, the latest version of the popular writing app for macOS, features more than three hundred new features and refinements since the app was last available on the Mac App Store. It also introduces a new pricing model: unlike direct purchases from Bare Bones Software, where an app license can (still) be purchased for a one-time $49.99 cost, on the Mac App Store BBEdit is available only as a subscription.

For those who wish to get BBEdit from the Mac App Store, the app is a free download, and you can use it in full up to 30 days at no cost, after which a subscription will be required to unlock its web authoring tools and a variety of other pro features; basic editing functionality will continue to work without a subscription, however.

Subscriptions are available at $3.99/month or $39.99/year. One advantage of the subscription option is that it will always provide access to the latest version of the app, whereas purchasing the app directly from Bare Bones will earn you the current version of the app only – if you want major new versions as they’re released, you’ll need to purchase upgrade licenses.

When Apple unveiled the new Mac App Store last year, it promised that not only would the app itself be modernized, but the store would be ripe with major app additions as well. Following Microsoft Office and Panic’s Transmit, BBEdit’s arrival today helps make good on that promise. This time last year some of the Mac’s best, most popular software wasn’t available in the Mac App Store; it’s good to see that begin to change.


PageTurn Uses Facial Recognition for Hands-Free Navigation of PDFs, Perfect for Musicians

Developer and musician Stephen Coyle just released a new app that enables hands-free page turning of PDFs via facial expressions. The aptly-named PageTurn utilizes the power of the TrueDepth camera system found in all iOS devices that support Face ID – the iPhone X, XR, XS, and XS Max, plus the 2018 iPad Pros – to enable turning pages of a PDF using only your face.

There are two options of facial gestures available to control page turning: mouth control, which is the default, or wink control. Mouth control works by tracking the movement of your mouth: if you move it right, you’ll advance forward a page, while moving it left goes back a page. Wink control advances forward with a right wink, and goes back with a left wink. With both of these options, PageTurn provides the ability to set sensitivity so you can customize each gesture to whatever’s most comfortable for you. It feels odd at first making these gestures to turn pages, but in my experience it quickly became comfortable.

PageTurn was designed primarily for musicians, who often bear the unenviable task of turning pages of sheet music while both their hands are occupied playing an instrument. It works with any PDF though, so readers can have hands-free page navigation as well. You can get PDFs into the app via the import button in the upper-left corner, which opens a Files picker, or if you have a PDF open in another app, you can copy it to PageTurn using the share sheet.

PageTurn is a simple utility, but for those who could benefit from it – musicians in particular, and also users with accessibility needs – it’s a potentially revolutionary tool that enables new ways of doing a common task that weren’t previously possible. The app is a shining example of the creativity of indie developers.