Take Control of Automating Your Mac (5.0)
Take Control of Automating Your Mac (5.0)
0
Downloads, Updates, Feedback
TAKE CONTROL OF
AUTOMATING
YOUR MAC
d l y g u i d e t o
A frien g )
( o r c r e a t i n
finding c u t s .
s h o r t
time-saving
by JOE KISSELL
$14.99
5 TH
EDITION
Table of Contents
Read Me First ............................................................... 6
Settings vs. Preferences ..................................................... 7
What’s New in the Fifth Edition ............................................ 7
Introduction ................................................................ 8
2
Control Anything with a Stream Deck ................................. 77
Learn About Other Special Input Devices ............................ 78
3
Discover macOS Automation Technologies .............. 166
Apple’s Core Automation Technologies .............................. 166
Using JavaScript for Automation ...................................... 168
Using Swift for Automation ............................................. 170
4
Run Actions Automatically ....................................... 232
Use Login Items ............................................................ 233
Use Calendar Events ...................................................... 235
Use Launchd ................................................................. 238
5
Read Me First
Welcome to Take Control of Automating Your Mac, Fifth Edition,
version 5.0, published in January 2024 by alt concepts. This book was
written by Joe Kissell and edited by Glenn Fleishman.
This book explores many ways to work faster, increase your efficiency,
and have more fun using your Mac by automating common activities.
Many of these techniques require no extra software, and nearly all of
them are suitable for ordinary users without special technical skills.
If you want to share this ebook with a friend, we ask that you do so as
you would with a physical book: “lend” it for a quick look, but ask your
friend to buy a copy for careful reading or reference. Discounted
classroom and Mac user group copies are available.
• Download any available new version of the ebook for free, or buy
any subsequent edition at a discount.
• Access the book in both PDF and EPUB formats. (Learn about
reading on mobile devices on our Device Advice page.)
• Read the ebook’s blog. You may find new tips or information, links
to author interviews, and update plans for the ebook.
If you bought this ebook from the Take Control website, it has been
added to your account, where you can download it in other formats
and access any future updates. However, if you bought this ebook
elsewhere, you can add it to your account manually; see Ebook Extras.
6
Settings vs. Preferences
In macOS Ventura, Apple replaced System Preferences with System
Settings, and in most apps, the Preferences menu item and window
became a Settings menu item and window. In this book, I sometimes
use a shorthand like “go to Mail > Settings/Preferences” or “open
System Settings/System Preferences” to reflect both possibilities; when
the details are significantly different, I spell them out separately as
“Ventura or later” and “Monterey or earlier.”
• Rewrote the topic about Mail plugins, now called Automate Apple
Mail with Extensions or Plugins, to account for the fact that Sonoma
dropped support for plugins in favor of extensions
7
Introduction
If you’ll forgive the cliché, life is too short. I have long-term goals and
dreams that need my attention. And every single day, I have work to
do, a family to take care of, books to read, and TV shows to watch. I
don’t have time to waste on tedious tasks that my expensive, modern
Mac is perfectly capable of handling for me.
This book is about taking back your time by automating your Mac,
which sounds like a fancy and high-tech undertaking. But in fact, all I
mean by “automating” is finding shortcuts: ways to do the same thing,
only more quickly and easily, with fewer manual steps. That might be
as simple as learning a keyboard shortcut for a common command or
scheduling a task to run at a certain time. You can accomplish more
advanced automation tasks, too, by using macro utilities or writing
AppleScripts, but you might be surprised to find that some of the most
powerful and effective automation techniques require the least effort
and skill to set up. In many cases, you won’t even need extra software.
8
Now, you may be thinking, “That’s madness! Why would anyone spend
a whole day automating something that takes just five minutes?” Well,
I did it to save time. My calculation is that those eight hours are
equivalent to five minutes a day for about three months—so after three
months of using the macro, I get five extra minutes every single day to
spend with my kids. That adds up: it’s more than 30 hours over the
course of a year. All of a sudden that sounds pretty smart!
Many of the topics I discuss are deep, and I can only scratch the
surface in a book like this. For example, Sal Soghoian and Bill Cheese-
man once wrote an 895-page book on AppleScript, while I spend just a
chapter on it. Other Take Control authors penned entire titles about
Shortcuts, LaunchBar, and TextExpander, covered in this book only
briefly. And I could write hundreds of pages about Keyboard Maestro,
Nisus Writer Pro macros, and other topics. Automation is a virtually
endless subject, but I’m sure you don’t want to read thousands of pages
about it!
• Show you lots of automation tools and techniques for your Mac.
The techniques in this book work with macOS 10.14 Catalina through
macOS 14 Sonoma unless otherwise noted. Most of them work in older
Mac operating systems, too—although the older your operating system,
the less likely you’ll find that everything works as described.
9
Automation Quick Start
There are dozens, if not hundreds, of ways to automate your Mac. This
book explores many of the most interesting options. I suggest that you
first read the Introduction and Develop an Automator’s Mindset. Then
dip in wherever you like and jump around to techniques that interest
you. If you’re interested in ways of automating your Mac that require
no extra software, pay special attention to the second chapter, Use
Built-In Automation Features.
Automation 101:
• Where things stand: Get a snapshot of the changing Mac au-
tomation landscape; read The State of Mac Automation.
• Strategy: Learn what you can automate and figure out where you
can save time and effort in Develop an Automator’s Mindset.
• Built-in features: Discover the many ways you can make your
Mac more efficient using nothing more than what Apple supplies in
macOS; see Use Built-In Automation Features.\
• Finder: Launch apps, open files and folders, play music, look up
definitions, perform calculations, and much more with just a few
keystrokes; see Automate the Finder.
• Clipboard: Cut, copy, and paste like a pro using multiple clip-
boards, clipboard histories, and tools to manipulate what’s on your
clipboard; see Supercharge Your Clipboard.
10
• Apps: Use capabilities built into major apps like Word, Excel,
Nisus Writer Pro, and FileMaker Pro to automate repetitive or
complex actions; see Automate Individual Apps.
• Backup and sync: Keep your data safely backed up, and optional-
ly keep it in sync across more than one Mac; see Automate Backup
and Syncing.
11
The State of Mac
Automation
When I updated this book to its third edition in 2019, I wrote about
huge changes that had taken place in the world of Mac automation in
the previous few years. Remarkably, even more changed since then, so
it’s time once again to report and reflect on the good, the bad, and the
unknowns of the Mac’s automation present and future.
In 2014, when this book’s first edition appeared, I thought Apple was
likely heading in a direction towards more and better automation
capabilities. Various Apple teams seemed to be paying greater atten-
tion to automation. Since then, signals have become decidedly mixed.
For starters, Apple laid off their key person behind automation for 20
years, Sal Soghoian, in 2016. Apple didn’t replace Sal with anyone else,
and, to all appearances, his departure from the company coincided
with a growing indifference toward Mac automation at Apple. In a
depressing shift, new and updated Apple apps began losing, not
gaining, automation capabilities via AppleScript and Automator.
So that’s the bad news. And if I had written this update a few years
earlier, I might have concluded that Mac automation as a whole was on
a hopelessly downward slope. But then a crazy thing happened: Apple
took their popular Shortcuts automation app for iOS/iPadOS and
12
adapted it to work in macOS too, starting in Monterey (see Get Started
with Shortcuts).
So where does that leave us? I don’t have any inside knowledge of
Apple’s corporate thought processes or business plans, but I can make
some informed predictions:
13
of macOS. Although individual apps may drop support for specific
automation technologies, I expect that most workflows you build
today with the most prominent Apple tools—Shortcuts, AppleScript,
and probably even Automator—will still be functioning in five years.
Taking all of the above into account, including the bad news, I feel
fairly positive about a broader picture of automation on the Mac—one
that isn’t defined solely by Apple’s decisions. Here’s why:
• In many respects, Apple takes a “let’s leave well enough alone” ap-
proach to the guts of macOS. Notwithstanding the removal of Unix
scripting languages mentioned above, there are oodles of other old
Unix utilities still kicking around in macOS. They’re not doing any
harm, and some problems might arise if they were removed, so they
largely remain in place, even without a strong argument as to why
14
they’re needed. The same could be true of today’s built-in au-
tomation technologies.
• Even though app extensions, Swift, and so forth don’t meet the
general need for automation tools today, they’re evolving and might
eventually meet the bar. Perhaps Apple or a third-party developer
will invent some entirely new technology that will make today’s
options seem quaint.
15
Develop an Automator’s
Mindset
I think of myself as a relatively lazy person. I mean, yes, I’ve written 63
Take Control books (and counting) in the last 20+ years. And yes, I’ve
written numerous other books, too, not to mention hundreds of arti-
cles for Macworld, TidBITS, and other sites. And sure, I run a publish-
ing company, speak all over the world, have a wife and two kids at
home, and teach tai chi classes. But apart from those minor exceptions
and maybe a dozen others, I’m pretty much a layabout.
However, there’s more than one way to think about laziness. When it
comes to your Mac, a good form of laziness is not wanting to spend
unnecessary time doing something that’s tedious or repetitive. A bad
form of laziness is not bothering to figure out how to save yourself that
effort later on.
Note: To get a visual sense of how much time you might save in the
long run, see the xkcd comic Is It Worth the Time?.
But saving time isn’t the only reason to automate activities on your
Mac. You’ll also make your work more consistent and accurate. Au-
tomation can prevent small errors that would otherwise trip you up,
and save you the annoyance of looking up forgotten details.
As you read about automation methods, I want you to accept the fact
that you’ll have to spend (not “waste”) time learning, experimenting,
and setting things up, and that this work is going to be a temporary
16
drag on your productivity. Don’t worry about it. The end result will
make you much more productive. Bear in mind, too, that the effort-to-
reward ratio is least favorable at the beginning, as you’re getting to
know the tools and techniques. But as you gain experience, you’ll find
that smaller amounts of effort produce greater rewards.
Your biggest challenge may be figuring out what you can automate and
how. That’s what I want to address in the remainder of this chapter.
I use such a broad and inclusive definition because I want you to get in
the habit of looking for easier ways to do things on your Mac without
the psychological barrier of thinking that automation is some intensely
technical process only a computer geek could grasp.
You probably wouldn’t have bought this book if you weren’t already
interested in simple labor-saving shortcuts: if there’s something you do
frequently that requires three clicks and you can come up with a way to
do it with one click instead, you’ve saved yourself some effort. Or
maybe you have a regular task that normally requires a dozen key-
strokes and you can do it with a single menu command instead.
Once you feel confident finding shortcuts like these, you can work your
way up to the more conventional sense of automation—setting up your
Mac to perform complex sequences of useful tasks without any inter-
vention. These could be tasks you would do anyway, or they could be
tasks that would be too complicated, time-consuming, or onerous to
bother doing by hand—tasks such as sorting your incoming email,
monitoring sales figures, or moving files between disks or machines.
Keep in mind, however, that since it takes some time to set up any
automation task, automation saves time only when the activity in
question happens over and over again. Suppose an app has a deeply
17
nested menu command, like Tools > Format > Paragraph > Style >
Quote Level > Increase, and it’s a pain to find it and select it. You could
assign it a keyboard shortcut, but if it’s a command you use only on a
rare occasion, there’s no point. It would take more effort to set up (and
remember) the shortcut than to search for the command manually. On
the other hand, if this is a command you use several times every day,
it’s certainly worth your effort to find a quicker way.
Mechanical tasks:
• Select all the black pixels in an image.
• Click your pointer at a spot 50 pixels from the left edge and 120
pixels from the top edge of the frontmost window.
• Compose a poem.
Broadly speaking, mechanical tasks are the ones that most readily lend
themselves to automation. While writing this book, I used automation
18
for things like expanding abbreviations, applying styles, creating
bookmarks, inserting cross-references, and modifying URLs. None of
my automation tools helped me figure out what to write, however.
Crucially, you can automate such tasks (and sequences of tasks) even
in cases where variables are involved or decisions are required—
automation need not be blind. For example, you might have a macro (a
structured series of automated actions) that looks at the text on a
certain webpage and, depending on what that text is, takes one of three
actions in response. You might have a command that runs automati-
cally—but only on rainy days, or only if there are fewer than five
messages in your email inbox. You might even have your Mac prompt
you to make a decision manually, or fill in some information, before
proceeding with an automation task.
19
As you use your Mac, pay attention to activities that are largely me-
chanical in nature, that you perform more than a few times a day, and
that require more than a single click, keystroke, or menu command.
Jot down what those activities are, and as you read this book, look for
appropriate ways to automate each task. Even if you know for sure that
you want to automate something, it’s not always convenient to drop
everything and do so at the moment you realize it. Having a list helps
you remember what to come back to when you do have time.
Click Less
Although it’s not a perfect measurement of complexity, it’s a conve-
nient way to think about the effort needed to perform common tasks:
How many clicks does it take?
If you click the Finder icon in your Dock to switch to the Finder, click
File > New to open a new window, click on the name of another Mac in
the sidebar, and then click Share Screen to share the screen, that’s a
total of four clicks.
All things being equal, fewer clicks take less effort than more clicks, so
if you can find ways of reducing multiple clicks to a single click (or
perhaps to a keyboard combination), you’ll save effort.
20
What to do: Pretty much any automation I discuss has the potential
to eliminate clicks. Areas that may especially apply, however, are these:
• If you want to copy and paste multiple items quickly, start with
Supercharge Your Clipboard.
• If you want to switch applications with your voice, try Control Your
Mac with Your Voice, or find other options for quickly getting in and
out of apps in Automate the Finder.
Type Faster
If you don’t already know how to touch-type (that is, type with all ten
fingers, without looking at the keys), learning to do so will probably
save you more time and increase your efficiency more than anything
else in this book. You can find numerous free or inexpensive apps to
help you learn, such as Mavis Beacon Teaches Typing.
But if you’re already a touch typist, you can increase your typing speed
and accuracy even further. For example, I frequently write about an
app called DEVONthink To Go, but I never type out all 16 characters of
that name. I type dttg and my Mac expands that automatically into the
full name. That not only saves time, but also ensures I get all the
capitalization right. I do the same thing with frequently typed names,
addresses, phone numbers, URLs, dates, and other phrases—especially
those that I use more than a few times a day.
Write it down: Consider all the email messages and documents you
wrote in the last 24 hours, and see if you can pick out long names,
phrases, and other text you used repeatedly, such as a company name,
chemical name, or address. Make a note of them.
21
Use Keyboard Shortcuts
One premise underlying many of the automation techniques in this
book is:
To the extent that this is true, it would seem logical to learn (or create)
as many keyboard shortcuts as possible. But I wouldn’t go so far as to
say that keyboard shortcuts are always or even usually faster than
using a pointing device. And let’s not forget the mental effort required
to learn and recall all those shortcuts!
Tip: For a fascinating glimpse into research Apple did in this area in
the late 1980s, read Bruce “Tog” Tognazzini’s articles “Keyboard vs.
The Mouse,” part 1, part 2, and part 3.
22
Shortcuts in Microsoft Word and Use Multi-Key Shortcuts in Nisus
Writer Pro)
Write it down: Make a note of tasks you perform several times a day
that require searching for menu commands, as well as those you repeat
two or more times in a row.
What to do: In some cases, you can learn their existing shortcuts (see
Use the Mac’s Built-In Keyboard Shortcuts), but if they don’t have
shortcuts—or you don’t like the built-in shortcuts—you can assign
keyboard shortcuts to them (see Make Your Own Keyboard Shortcut
and Use a Macro Utility).
Some automated actions can and should run without any intervention
at specific times or at recurring intervals, such as opening an app or
running a script or macro. As you find applicable cases, you can tell
your Mac to run them according to the calendar and clock. Or, you
might notice some activities that should be triggered automatically in
response to something else, such as restarting or logging in, mounting
a network volume, or changing the contents of a folder. In all these
cases, you can make your life that much easier by setting up automatic
triggers for your automated actions.
23
some way—such as “every Tuesday morning at 9, I do this” or “as soon
as x happens, I always do y.”
24
Although most apps can be automated by brute force, as it were—
having a macro utility fake a click at certain coordinates in a window,
for instance—that kind of automation is tricky and error-prone. Apps
that expose their functions directly to tools like Automator, Apple-
Script, and LaunchBar make automation much easier. That’s why I talk
glowingly about the automation possibilities in Microsoft Word, Nisus
Writer Pro, DEVONthink, Panorama X, and 1Password. They go out of
their way to make it easy for other apps to communicate with them.
You may also need to request some adjustments to the way other
people send you data in order to facilitate automation. For example,
data you receive in a highly structured form, such as a spreadsheet,
database, or XML file, lends itself well to automation because it’s easy
to instruct a computer to look in a certain field, cell, or key for a piece
of data. Receiving data as a free-form PDF or Word file complicates
automation, because you first have to automate the task of locating just
the needle you need in a fairly large haystack.
These are just a few examples, but my main point is to keep auto-
mation in mind as you make decisions about the apps you use and the
ways you send and receive information. Even if you don’t use those
capabilities now, you may appreciate them in the future.
25
Make Friends with Metadata
Metadata is “data about data”—for example, a song’s data is the
music you hear, but metadata includes the song’s title, composer,
performer, album art, lyrics, and so on—as well as its star rating, if
you gave it one in Music, and any comments you added to its de-
scription. Similarly, files can have metadata such as tags and com-
ments; photos can have titles, ratings, and location information; and
email messages can be marked as sent, read, or junk.
If you get in the habit of adding metadata where it’s appropriate,
you’ll make automation that much easier later on. For example, if you
always mark your favorite songs with 4 or 5 stars, then it’s easy to
make playlists that include only your favorites. Tag your files, and
then it’s easy to use those tags to make smart folders (see Create
and Use Smart Containers). Mark your favorite photos, and then it’s
easy to find them at the end of the year when generating a holiday
card or to show only your favorites to your friends at your college
reunion.
Without question, adding metadata, after the fact, to hundreds or
thousands of existing items is an extraordinary time sink that is
seldom worth the effort. But adding it to new items as you go can
open up interesting automation possibilities in the future.
Instead, I suggest you read through this book with the idea of picking
out just the handful of techniques and apps that give you the biggest
bang for your buck (or your time). The answer will be different for each
person; it’ll depend on how you use your Mac and what your biggest
sources of annoyance are.
26
I asked myself: If I could pick only one automation tool from this book,
which one would it be? For me, that tool would be Keyboard Maestro
(see Control Your Mac with Keyboard Maestro), because it’s so versa-
tile. It may not be the best launcher or the best clipboard utility or the
best text-expansion tool, but it does a respectable job at all those
tasks—in addition to its crucial core features of creating macros and
letting you assign keyboard shortcuts to commands.
Finally, I should caution you not to buy automation apps just because
they sound neat, or because you hope to think up problems for them to
solve. That’s like going to the hardware store and buying a tool without
having anything you need to use it for. (Which, I admit, I’m prone to
do, but I don’t recommend.) Start with the problems you want to solve,
and then find an app or technique that can solve them.
27
Use Built-In Automation
Features
Although it may not be apparent at first glance, macOS contains
dozens of built-in automation features, just waiting for you to make
use of them. In fact, later in this book, I’ll discuss numerous ways to
take advantage of built-in features, such as:
28
Use the Mac’s Built-In Keyboard
Shortcuts
Every app that comes with macOS, including the Finder, has keyboard
shortcuts for common commands.
Menu Shortcuts
The best-known type of keyboard shortcut performs a menu command.
You can see the shortcuts right on the menus (Figure 1).
You likely already know that ⌘ means Command; the ⌘ symbol dates
back to the first Mac. Symbols you may be less familiar with represent
three other modifier keys:
• ⌥ means Option
29
• ^ means Control
• ⇧ means Shift
So, if you see a command labeled ^⌘T (File > Add to Sidebar in the
Finder), that means hold down both the Control key and the ⌘ (Com-
mand) key and press T.
The easiest way to learn what keyboard shortcuts are available for
menu commands is to look at the menus as you use them.
Although every app has its own shortcuts, most apps are consistent in
their use of common shortcuts, such as:
30
• Return to click the default (highlighted) button in any dialog
• ⌘-. or Esc to cancel the current action
Every Mac user should know these common shortcuts cold, because
they’re useful in nearly every app.
Tip: Try pressing the Option key while displaying a menu. In many
cases, the commands (and their associated shortcuts) change to
reveal hidden options. (This also works with other modifier keys, such
as Shift and Control, but those are used less frequently.)
For many more shortcuts, see Apple’s Mac keyboard shortcuts page.
31
Text Editing Shortcuts
Besides shortcuts for menu commands, macOS has many built-in
shortcuts for working with text. Here are a few you should know:
• Arrow key: Move the insertion point in the direction of the arrow.
• ⌘-↑ or ⌘-↓: Move the insertion point to the top or bottom of the
document.
• Shift plus any of the above: Select text from here to the destina-
tion. For example, Option-Shift-→ selects the next word, while
⌘-Shift-← selects to the beginning of the line.
3. In the dialog that appears (Figure 2), select the app you want the
shortcut to work with from the Application pop-up menu. (If you
32
don’t see it listed there, choose Other, navigate to the application,
and click Add.) If you want your shortcut to work in all applications
(or in, say, the pop-up PDF menu that appears in the Print dialog of
all your apps), choose All Applications from the pop-up menu.
4. Enter the menu command—for example Paste, (not the name of the
menu itself—for example, Edit) for which you want to specify a
shortcut in the Menu Title field.
33
an ellipsis (…) at the end of a command, you can type either the sin-
gle ellipsis character (Option-;) or three periods. Either way works.
5. Click in the Keyboard Shortcut field and press the key combination
you want to use. (If another command previously used the shortcut
you enter, your new shortcut will override it.)
Sometimes an app has two or more menu commands with the same
name, located on different menus or submenus. For example, in Mail,
you can find Format > Quote Level > Increase as well as Format >
Indentation > Increase. Likewise, the mailbox names on the Message >
Move to and Message > Copy to submenus are the same. So if you
specify only the menu command name (like Increase), it may not
connect to the right command.
Tip: Some apps also have built-in mechanisms for creating keyboard
shortcuts. You can use whichever method you prefer, but an app may
give you more control—for example, Nisus Writer Pro lets you assign
sequences of keystrokes as shortcuts (see Use Multi-Key Shortcuts in
Nisus Writer Pro).
34
If you’re uncertain what keyboard shortcuts might be useful, here are
some ideas to get you started:
• If you frequently assign tags to files, you may want to assign a key-
board shortcut to the Finder’s File > Tags… command. ⌘-T, ⌘-
Shift-T, and ⌘-Option-T are already used by other menu com-
mands, but you can reassign any of them to Tags… if you like.
• How about an All Applications shortcut to open System Settings/
System Preferences (found with a trailing ellipsis […] on the Apple
menu)?
• Lots of apps have Check for Updates… commands (usually on the
application menu—the one bearing the application’s name), but
that command almost never has a shortcut. If you use it frequently,
it might benefit from an All Applications shortcut.
• Your keyboard may have keys you rarely if ever press (F13–F15,
anyone?), and they can be put to good use. Most of these keys have
preassigned shortcuts, which you can see by looking through the
various categories of System Settings > Keyboard > Keyboard
Shortcuts (Ventura or later) or System Preferences > Keyboard >
Shortcuts (Monterey or earlier), but if you think a key can serve you
better by performing a different action, you should feel completely
free to change it.
35
Each toolbar has buttons and menus for commonly performed tasks,
but if you’re anything like me, you tend to ignore most of what appears
on a toolbar. After all, I don’t need a button for Save or Reply or Bold
as I invariably use keyboard shortcuts for these actions.
• Even though default toolbars are often pretty dull, you can cus-
tomize almost any toolbar to make it genuinely useful.
To illustrate the second point, consider Preview. Its default toolbar (as
it appears when a PDF is open) is shown in Figure 3.
That’s OK, I guess. But I’ve customized mine (Figure 4) to add several
more controls that I nearly always find useful when viewing PDFs:
Scale (which shows me the current zoom percentage and lets me type
in a different number to change the zoom), Previous and Next (for
navigating), and Page (which lets me type a page number to jump
directly to it). Sure, there are other ways to access these features, but in
this specific instance, I find the revised toolbar more efficient.
In fact, I go a step further and hide the labels (Figure 5), to give
myself a bit more vertical space.
36
Figure 5: My customized toolbar without labels.
2. Drag icons onto or off of the toolbar, or rearrange them as you like.
3. Click Done.
Note: Some apps, like Nisus Writer Pro, even let you make custom
toolbar items.
You can also choose Icon and Text, Icon Only, or Text Only from the
contextual menu to show or hide icons or labels.
Substitutions
As you work with text in supported apps, macOS can automatically
change certain attributes in order to make your text more readable.
When an item on the Edit > Substitutions submenu is checked, it
means that substitution is enabled for that app (only) until you dese-
lect it. (Choose a menu command again to toggle it.)
37
Substitution options are as follows:
• Smart Copy/Paste: If you double-click a word to select it, and
then copy and paste it, a space is added before and/or after if neces-
sary to separate it from the adjacent text. Similarly, if you double-
click a word to select it and then press Delete, extra spaces are
removed. (Smart copy/paste does not occur if you manually drag to
select the word.)
38
• Show Substitutions: Select this command to display the Substi-
tutions window (Figure 6), in which you can change any of your
settings for the current app (selecting or deselecting the checkboxes
has the same effect as selecting the corresponding menu command)
or apply substitutions retroactively.
Transformations
The Transformation submenu contains three commands that change
the case of the selected text:
39
Tip: Do you find yourself changing substitution settings or using
transformations frequently? Why not add a keyboard shortcut to the
relevant commands? See Make Your Own Keyboard Shortcut.
For times when you need to use your voice to perform specific func-
tions outside Siri’s skill set, you can also Use Dictation Commands.
This feature lets you run scripts, press keys, and do other custom
activities—that is, your voice can trigger shortcuts, just like a menu
command or keyboard shortcut.
Use Siri
Siri, Apple’s voice-controlled digital assistant, needs little introduction
at this point. Now that it’s part of macOS, it gives you many of the
same informational and control capabilities as its counterparts on
other platforms—plus some capabilities unique to the Mac. Here, I’ll
provide just a quick overview.
Before you can use Siri, you must enable it. You may have turned it on
while installing or upgrading macOS by leaving a checkbox selected,
40
which it is by default. But if not—or if you’re unsure—go to System
Settings > Siri & Spotlight (Ventura or later) or System Preferences >
Siri (Monterey or earlier) and make sure Enable Ask Siri is enabled.
(This appears as Enable Siri on older versions of macOS.) While you’re
there, you can also configure other options, such as which voice,
microphone, and keyboard shortcut Siri should use.
Once Siri is enabled, you can activate it so that it listens for and re-
sponds to vocal commands, in any of the following ways:
• Press the Siri keyboard shortcut. (By default, the shortcut is to hold
down ⌘-Space for about a second. You can change this in System
Settings > Siri & Spotlight (Ventura or later) or System Preferences >
Siri (Monterey or earlier), and I suggest that you do, because other-
wise it’s too similar to the default shortcut for Spotlight, which is to
press ⌘-Space and quickly release both keys.)
• Say “Siri” or “Hey Siri” on supported Macs. (To turn on this feature,
go to System Settings > Siri & Spotlight [Ventura or later] or System
Preferences > Siri [Monterey or earlier] and enable Listen for “Siri”
or “Hey Siri.”)
• With Voice Control enabled (see the sidebar Voice Control and
Dictation, ahead), say, “Open Siri.”
Siri responds with a couple of beeps and a “What can I help you with?”
window (Figure 7). You can then speak your question or command.
41
Siri doesn’t require your commands to follow a preset pattern. Within
reason, you can phrase your requests in everyday language and Siri
(usually) interprets them close to what you would expect.
• Launch Safari.
Although I rarely use Siri on my Mac, I find it most useful for com-
mands that would otherwise require multiple steps or digging around
in System Settings/System Preferences, like “What’s my Mac’s serial
number?” or “Enable Bluetooth” or “Show me PDFs with the label
Important.” For more suggestions on how to use Siri on your Mac, see
these articles:
42
Use Dictation Commands
Macs have a built-in Dictation feature that converts what you speak
into written text. Although that’s an interesting and useful capability—
and arguably a shortcut in some contexts—I don’t cover it in this book.
However, I do want to explain a different feature that helps you accom-
plish tasks with spoken commands: Dictation Commands.
43
Voice Control and Dictation
In addition to Siri, your Mac has a feature called Voice Control, which
lets you control your Mac interface with voice commands in a way
that goes far beyond Siri. You can effectively “click” interface ele-
ments with your voice. It also includes context-based automatic text
dictation, enabled whenever the cursor is at a text insertion point.
However, as I mentioned above, macOS also has a separate, stand-
alone Dictation capability that doesn’t offer access to interface-
interaction commands (and which I don’t cover in this book). It’s…
confusing. In the hope of clearing it up slightly, let me outline what
you can manage by voice:
✦ Siri: Siri can activate and deactivate Voice Control. (You can still
use Siri while Voice Control is active, too.)
✦ (Keyboard) Dictation: Standard or “keyboard” Dictation is
available wherever you can type text. It turns speech into text and
also recognizes some punctuation and other characters. You can
turn Dictation on via a key or keyboard shortcut set in System
Settings/System Preferences > Keyboard > Dictation.
✦ Voice Control: Command the interface, dictate text in contextual-
ly appropriate locations, and issue commands to edit text, like
“select paragraph and bold that.”
When Voice Control is on, you can’t use the standard Dictation mode.
But that’s generally OK, because dictation still works as long as the
insertion point is in a location where text can be typed—and com-
mands work there too.
If Voice Control is off, you can tell Siri to enable or disable Dictation,
which is the equivalent of going to System Settings/System Prefer-
ences > Keyboard > Dictation and enabling or disabling Dictation.
However, you can’t use Siri to start dictation mode; for that, you’ll
have to use whatever shortcut is specified in the Shortcut pop-up
menu. However, since commands are part of Voice Control, you can’t
use them in this mode—or even use your voice to edit the text you
entered.
Long story short: it’s generally better to stick with Voice Control than
the standalone Dictation capability.
44
To enable Voice Control, you can either ask Siri to do it (“Enable Voice
Control”) or follow these steps:
In Ventura or later:
Voice Control is now enabled and active. (To make it inactive, click
Sleep or say “Go to sleep.”)
Figure 8: This floating window tells you that Voice Control is enabled
and active (left) or inactive (right).
In Monterey or earlier:
Figure 9: This floating window tells you that Voice Control is en-
abled—though not necessarily active.
Voice Control is now enabled, but not yet active—to make your Mac
begin listening to your commands, click Wake Up or say “Wake up.”
45
(To make it inactive, click Sleep, as in Figure 9, right, or say “Go to
sleep.”)
With Voice Control active, you can speak a command, such as “Search
Spotlight for text” or “Switch to Finder.” (For a partial list of com-
mands you can speak, say, “Show commands.”)
You can even add your own commands. Custom commands can open
files or apps, paste text or other data, perform keyboard shortcuts, or
run Automator workflows (which, in turn, can include AppleScript,
JavaScript, and shell script code)—see Get Started with Automator.
46
To create your own Dictation Commands, follow these steps:
2. Click Commands.
4. In the “When I say” field, enter the word(s) you want your Mac to
respond to.
6. From the Perform pop-up menu, choose the action you want to
perform in response to the command, such as Open Finder Items,
Open URL, Press Keyboard Shortcut, or Run Workflow, and select
or enter the requested details.
8. Click Done.
To check for app updates manually, you open the App Store app and
click Updates. Then, to update a single application, click the Update
button next to it. (In some cases, Apple groups multiple software
updates together; click the More link to see details on each one.) To
47
update all the listed applications at once, click Update All. Enter your
Apple ID and password if prompted to do so, and click Sign In. The
App Store downloads and installs the updates.
Because software updates often fix crucial bugs and add important
features, I prefer to learn about them (and download them) as soon as
possible. I don’t necessarily install updates as soon as they appear,
because I might be busy with things that can’t be interrupted—and I
want to know when something might be about to change—but some
people may choose to do so as the fastest and most hands-off method.
Still others never want to be interrupted with alerts about new soft-
ware and dislike the idea of anything downloading behind their backs,
or they need to keep an eye on a bandwidth usage cap. You can decide
where you stand and configure your Mac accordingly.
48
Figure 10: Configure automatic updates for Ventura or later in this
settings pane.
49
Figure 12: Select which types of automatic updates you want here
(Ventura or later).
Figure 13: Select which types of automatic updates you want here
(Monterey or earlier).
50
If it’s enabled, you can also choose to enable any or all of:
Note: For additional App Store update preferences, open the App
Store app and choose App Store > Settings/Preferences.
51
Tip: If your Mac supports Power Nap (see What is Power Nap on
Mac?) and you enable it in the System Settings > Battery > Options
(Ventura or later) or System Preferences > Energy Saver (Monterey
or earlier), your Mac also downloads updates from the App Store
when it’s asleep—as long as it’s plugged in to AC power.
For now, do the following. Whenever you download and install a new
app that doesn’t come from the App Store, check its preferences to see
whether there’s an Automatically Check for Updates (or similar)
feature. If so, be sure to turn it on! If you can choose how often to
check, choose the most frequent option. You might also do the same
for your most frequently used apps the next time you open them.
52
Tip: Don’t just check standalone apps for an Automatically Check for
Updates feature; also look for this option in preference panes, status
menus, Mail plugins, and other such software. The wording of the
command may vary, but such commands (Figure 14) usually appear
in the application menu, the Help menu, or the Preferences window.
53
knowledge, with minor variations, in lots of different places, many of
which I cover in the next topic (Create and Use Smart Containers).
For example, I can search for all files that both (a) contain the word
“book” and (b) were modified within the last week, in which case
files that have one of those attributes but not the other wouldn’t
show up in such a search. This is known as an All search, because all
the conditions must match.
Or I can search for files that either contain the word “book” or were
modified with the last week, which would match a much larger
number of files. This is known as an Any search, because matching
any one of the conditions is enough for a positive result.
I’ll use the Finder to illustrate how to set up a rule-based search; just
remember, you’ll follow the same steps wherever you use this tech-
nique.
54
To perform a rule-based search in the Finder:
1. Press ⌘-F (for Find). The insertion point jumps to the Search field
in the upper-right corner.
2. Type some text in that field, such as book. The window begins filling
with all the files on your Mac containing that text. Press Return to
search for the text you’ve entered in the contents of any file, or
select a narrower category (such as “Name matches: book”) from
the pop-up menu that appears.
Your search now has its first condition, such as “must contain the
text book,” but you can change that later.
4. Click the plus button next to the Save button (below the Search
field). A new row appears (Figure 15).
Figure 15: Click the plus button to see a new condition row.
5. From the leftmost pop-up menu in this new row, choose an at-
tribute to search for, such as Kind, Name, or Contents.
Depending on what attribute you choose, the rest of the row may
change. For example, if the attribute is Kind, then the only thing left
in the row is a single pop-up menu you can use to pick a kind. But if
you choose [Created Date], you see additional pop-up menus and/
or fields (Figure 16), where you can specify, for example, is
[Within Last] [12] [Days].
Figure 16: As you change attributes, the rest of the row adjusts.
With each choice you make, the rest of the row adjusts accordingly.
For example, if you chose [Created Date] followed by is [exactly],
55
then the remainder of the row changes to show only a date field
where you can enter a single, specific date.
Use the pop-up menus and fields to specify your entire condition.
Tip: In Finder searches, you can add many attributes to that leftmost
pop-up menu. To learn more, read my Macworld article Six quick
Spotlight tips, which is from 2013, but remains largely accurate.
6. To add a second condition that will narrow the search, click the plus
button at the right of the current condition and repeat step 4.
Note: In most apps that use search rules like this, a pop-up menu
with Any, All, and sometimes None appears above the conditions
either all the time (or as soon as you add a second condition). In the
absence of an explicit menu, assume it’s an All search—that is, all
conditions must be satisfied for an item to match.
Figure 17: When you hold down Option and click the ellipsis
button, your search options expand considerably.
56
That may seem like a lot of steps, but most of them are optional—and
once you’ve done a few searches this way, the process will seem both
quick and obvious. With this technique under your belt, you can now
move on to create smart containers.
Note: When you construct rules in Mail (see Manage Incoming Apple
Mail with Rules), Hazel (see Organize Files with Hazel), and other
such apps, the search conditions are only part of the equation—you
then go through a similar procedure to specify what action(s) should
occur when an item matches.
• Smart folders (Finder): Choose File > New Smart Folder (⌘-
Option-N), or create a search rule as described in the previous topic.
When you’re finished, click the Save button in the search bar. Give
the smart folder a name, choose a location (the default is ~/Library/
Saved Searches), and for maximum convenience, also check Add to
Sidebar. Click Save. Thereafter, select that item in a Finder
window’s sidebar (or open it wherever you saved it) to show
currently matching items.
57
will gain additional power in macOS Ventura. For now, they rely on
tags, which you can type in any note to categorize it—just type a
word preceded by a pound (#) sign, such as #cooking. Having added
tags to some of your notes, you can then create a smart folder that
shows only notes with specified tags. To do this, choose File > New
Smart Folder, type a name for your smart rule, and then select one
or more tags. Click OK. The smart folder appears in the sidebar on
the left side of the Notes window.
• Smart playlists (Music): In Music, choose File > New > Smart
Playlist (⌘-Option-N). Fill in the desired conditions, and optionally
select the checkboxes to limit the playlist to a certain number of
tracks, match only checked items, or use live updating.
To view and play the items in that playlist, select Playlists (if the
sidebar isn’t already visible) and then select the smart playlist.
58
Note: To edit an existing smart playlist, mailbox, album, or group,
right-click (or Control-click) it and choose Edit Smart Container Type
from the contextual menu.
If you’re still not sure how a smart container might serve as a useful
shortcut, consider these ideas:
• A smart folder that shows all the files created or modified in the
preceding calendar year that also have the tag tax info, regardless
of the files’ locations. Handy for tax time!
• A smart mailbox that shows you all the messages you sent or re-
ceived in the last month that mention a certain family member,
regardless of where those messages are filed.
• A smart group in Contacts that contains all the other parents of kids
in the same class as your child. You can do this by having a smart
group [Note] [Contains] [school] and then putting the word
“school” in the Note field of each parent’s contact. As the class
composition changes, you can add or remove “school” from records,
and the smart group updates automatically.
59
Unfortunately, Apple’s go-to solution for any perceived security or
privacy threat is to display an alert with limited details, letting you
decide whether or not you trust the app to perform a given activity.
That can result in a long series of alerts. Apple provides too little
information to judge the safety of what it’s asked us to approve. So
most of us simply end up agreeing to all of them so we can get back to
work. (In some cases, we must do more then just click a button, but it’s
unclear how the extra steps to enable certain kinds of apps to do their
thing makes our lives better.)
The more recent your version of macOS, the more of these alerts you’re
likely to see, and it’s particularly bad as you launch apps for the first
time. For better or worse, the types of automation activities covered in
this book are especially likely to prompt these alerts, because they’re
also the sorts of things that malicious software might want to do
behind your back.
So, before leaving this chapter about the Mac’s built-in automation
features, I wanted to be sure to tell you about security features that can
interfere with automation—whether you’re using Apple’s software or
third-party apps.
Accessibility Access
Apps that manipulate the user interface in one way or another to
provide system enhancements and extra features may need you to
approve them to use Apple’s accessibility features. Examples include
launchers, macro utilities, text-expansion utilities, scripting tools, and
AppleScripts that use GUI scripting—among many others. Even apps
that come with macOS itself (such as Script Editor) may fall into this
category, depending on how you use them.
When one of these apps needs your permission to run, you’ll see an
alert like the one in Figure 18.
60
Figure 18: To grant an app permission to control parts of your Mac’s
user interface, click Open System Settings/System Preferences. To
refuse, click Deny.
You can’t grant this type of access right in the alert dialog. Instead, do
the following:
61
Figure 19: Grant accessibility access to apps here.
Automation Access
Another category is automation access. To ask your permission, an app
displays a dialog like the one in Figure 20.
62
Figure 20: This app is asking you for automation access.
You may notice that this dialog specifies the name of an app (in this
case, Finder). Any app or utility that requests automation access must
do so individually for each app it wants to control. So you may see this
alert multiple times per app. To grant automation access immediately,
just click OK in the alert. Alternatively—or if you change your mind
about an app later—do the following:
• Ventura or later: System Settings > Privacy & Security > Au-
tomation (Figure 21). Click the disclosure arrow next to a utility,
and then turn the switch on or off for each app that utility wants to
control via automation access.
63
Figure 21: For each app that has requested automation access,
enable the apps you allow it to control.
If an app or utility needs access to your files, it will generally notify you
in some way. There’s no single systemwide alert for this purpose, but
you may see either a standalone dialog or a message somewhere within
the app asking for access.
64
Like Accessibility Access, Full Disk Access requires you to manually
grant permission. If an app needs this control, do the following:
Figure 22: The Full Disk Access category enables apps to access
data anywhere on your disk.
Some apps that need Full Disk Access do not notify you. Because of
this, they can be completely nonfunctional until you figure out that you
65
need to follow the above steps—and, more confusingly, figure out
where to select the precise app file that requires access.
One such app is Terminal. Some operations that use the sudo com-
mand (such as changing file ownership with chmod) work only if you’ve
added Terminal to the list of apps in Full Disk Access. (See this discus-
sion for more details.) Oh, and if you’re using Terminal to change
ownership on a remote Mac via SSH, you’ll need to choose Go > Go to
Folder in the Finder, enter /usr/sbin, and then drag the SSH daemon
(/usr/sbin/sshd) to the Full Disk Access list too.
Safari may also require Full Disk Access to open locally stored HTML
files that you want to preview in the browser. If you encounter this, I
recommend enabling Full Disk Access only while you’re previewing
locally stored HTML files, such as previewing webpages you’re modify-
ing, and then disabling it when done to avoid opening a web-based
security hole.
You can manage apps to which you’ve granted file access permission in
System Settings > Privacy & Security > Files and Folders (Ventura or
later) or System Preferences > Security & Privacy > Privacy > Files and
Folders (Monterey or earlier).
Keystroke Receiving
If an app needs to watch for keys being pressed—as is the case for
utilities like Keyboard Maestro, which lets you assign keyboard short-
cuts to arbitrary actions—you must explicitly allow that access. If a
newly installed app needs this capability, it will prompt you (Figure
23).
66
Figure 23: This app wants to be able to receive keystrokes.
Do the following:
Screen Recording
The term “screen recording” evokes capturing a movie of what happens
on your screen, and that is indeed something you need to grant per-
mission for explicitly. However, Apple uses the term more broadly to
identify apps that can actively watch what happens anywhere on the
screen, identify controls and other elements visually, and take action
on them, even if no recording is taking place. Apps such as Bartender,
BetterTouchTool, DEVONthink, and Keyboard Maestro rely on these
capabilities for their automation features.
67
Figure 24: This app needs access to your Mac’s screen recording
capability.
To grant this access or manage which apps already have access to your
screen in this way, go to System Settings > Privacy & Security > Screen
Recording (Ventura or later) or System Preferences > Security &
Privacy > Privacy > Screen Recording (Monterey or earlier).
68
Automate Your Input
Devices
We’ve talked about your keyboard already, and we return to it in
several future chapters. But I want to take a moment to talk about
other input devices, such as the one you use to move your pointer, as
well as game controllers and other special-use input devices.
69
another. For example, when I received a message from Don, my
computer went Zing! but when Debra sent me a message, it went Pop!
Everyone had a custom sound for each other person in the room.
Is your head spinning yet? Well, here’s the result of our labors. I click
button #2 on my trackball and Don’s computer makes a Crack! sound.
Don clicks button #3 on his trackball and Debra’s computer makes a
Ping! sound. Cris clicks button #4 on his trackball and my computer
makes an Oof! sound. And so on. So we spent half the day zapping each
other with our trackball buttons. You had to be there, I guess, but it
was hilarious, like a virtual pillow fight.
You must configure your trackpad or mouse with the gestures you
want to use—that’s the easy part. The harder part is training your
fingers to perform these gestures until they become second nature.
70
To set up your multitouch trackpad or Magic Mouse:
4. Some gestures have multiple options—use the pop-up menu for the
gesture to specify your preference. For example, in the More Ges-
tures view of the Trackpad pane, the “Swipe between full-screen
applications” gesture can be performed by swiping left or right with
either three fingers or four fingers.
71
5. Practice the gestures you’ve just configured! You may find it helpful
to create a little cheat sheet with the gestures and settings you’ve
chosen (e.g., “4 L/R to switch apps”) until you’ve memorized them.
Use BetterTouchTool
Unfortunately, Apple’s settings/preference panes offer no way to
assign custom actions to trackpad and mouse gestures—you can’t, say,
swipe left with three fingers to run a script. If you want to do that sort
of thing, you need an incredibly powerful and customizable app called
BetterTouchTool, which lets you configure almost any combination or
sequence of taps, clicks, and swipes (with one or more fingers) to
perform keyboard shortcuts, menu commands, and a wide variety of
other actions.
72
The usual workflow is to add or select an app (or All Apps) in the
sidebar first, which specifies where the gestures you set up will oper-
ate. (While you can use the same gesture to mean different things in
different apps, I find that excessively confusing.) Next, select an input
device using the pop-up menu at the top of the window—that can be a
mouse, trackpad, keyboard, Touch Bar—or even a Siri Remote. Then
you add a gesture for that device, such as “Pinch With Thumb And 2
Fingers.” Finally, you specify what should happen when you perform
that gesture in that context.
• Among the many gestures you can use are taps, swipes, pinches,
and force presses with various numbers of fingers; sequences of
taps; sequences of keystrokes; freeform gestures you “draw” your-
self; and moving your pointer to a particular corner of the screen.
If that sounds intriguing, you can download a 45-day free trial of the
app to play with before making a purchase commitment.
73
To customize your Touch Bar:
Figure 27: You can customize Touch Bar behavior here in Ventura or
later; in Monterey and earlier, controls are a bit different.
2. From the “Touch Bar shows” pop-up menu, choose one of the
following (your options may vary depending on your version of
macOS):
Note: With App Controls, Quick Actions, or Spaces selected, you can
optionally enable Show Control Strip to display the Control Strip, an
expandable set of icons on the Touch Bar’s right-hand side for things
like brightness, volume, and search.
‣ Expanded Control Strip: This view shows all the icons (13 by
default) on the Control Strip all the time, as opposed to just when
you expand the strip when App Controls, Quick Actions, or
Spaces is selected.
‣ F1, F2, etc. Keys: This setting displays the function keys that
appear on non–Touch Bar Mac laptops. So, if you’re not much of
74
a Touch Bar fan, you might use this to approximate what your
keyboard would be like without one.
3. Regardless of your setting from the previous step, you can configure
the Touch Bar to show a different set of options when you hold
down the Fn key: from the “Press and hold fn key to” pop-up menu,
choose one of the other options listed above.
5. You may want to customize which icons the Control Strip includes.
To do this, click Customize Control Strip. Then drag icons from your
screen all the way down onto your Touch Bar. Then click Done.
Note that if the regular Control Strip is visible when you do this, you
can customize only the four icons it displays; to customize the
expanded Control Strip, first switch to a setting that displays it.
Most third-party input devices come with software that lets you cus-
tomize the controls. Kensington trackballs come with Kensington-
Works, Logitech pointing devices come with Logitech Control Center,
and Microsoft mice…somehow, even in 2018, include software only for
Windows. But no matter, you can still customize them with a third-
party utility called USB Overdrive, discussed next.
Other actions you can potentially assign to mouse buttons include:
• Right-clicking, Control-clicking, or clicking with other virtual
modifier keys
• Triple-clicking
76
Program an Input Device with USB
Overdrive
Many fine input devices come only with Windows software (or in some
cases, no software at all), but thanks to a piece of shareware called USB
Overdrive, Mac users can fully configure nearly any USB mouse,
trackball, keyboard, gamepad, joystick, or other HID (human interface
device) product—as well as most Bluetooth pointing devices. The app
functions in much the same way as KensingtonWorks and Logitech
Control Center—pick a device, pick a button, pick an action for that
button; repeat as needed.
If you were so inclined, you could get, say, a Logitech Extreme 3D Pro
joystick and program each of its 12 buttons, each of the 8 directions on
its hat switch, the throttle control, the joystick directions, and the twist
rudder control to do something different on your Mac. Of course, the
obvious use would be to program all the controls to work in a game
such as a flight simulator, but I’m just saying…if you wanted each
button to send a different person a blank email message that resulted
in a sound playing on their computer, you could.
77
In fact, I’m underselling the Stream Deck here because beyond assign-
ing unique actions to each button, every button also features a minia-
ture full-color display. That’s right: you can create a custom image that
accompanies the function you assign! Buttons can also change their
appearance based on a state (such as on or off). Pressing a button can
even switch your entire Stream Deck to a different layout, where all the
buttons change their functions. (You might have one layout just for
Photoshop, another for writing, and a third for podcasting.)
Now, it would be fair to say that there are other ways to do virtually
everything a Stream Deck can do. But the convenience comes from
both the direct connection of a single button to a specific task and the
visual feedback (what each button is for) combined with the tactile
pleasure of pressing a button to make a thing happen. If you have a
zillion keyboard shortcuts, assigning some of them to buttons on your
Stream Deck can reduce the burden of remembering so many.
78
A few examples of the many special-purpose devices that you might
consider are:
• Pageflip pedals let you turn the page of sheet music (forward or
backward) when viewing it on a screen rather than on paper.
79
Automate Text Expansion
Even if you’re a great typist, you can save time and increase your
accuracy by using software that watches what you type and dynamical-
ly replaces abbreviations you’ve previously specified with longer
chunks of text. (And if you’re not a great typist, such software can
increase your effective typing speed!)
Text expansion isn’t just for names and short phrases. You can use it
for addresses, phone numbers, URLs, boilerplate text for common
email replies, HTML code snippets, and so on. Depending on which
software you use for text expansion, your snippets might also include
styles (such as bold and italic), graphics, the current date or time,
variables, AppleScripts or shell scripts, the contents of the clipboard,
and more.
The great thing about text expansion is that you don’t have to do
anything special to use it—you simply type. You don’t need modifier
keys like Command or Control, and you don’t need to hunt for menu
commands. And it can be used nearly anywhere.
One catch, however, is that you must be careful when choosing abbre-
viations—since text expands as you type, you might end up making a
lame mistake if you’re not paying attention. For example, I thought I’d
use km as an abbreviation for Keyboard Maestro, but then I tried typing
a distance in kilometers and got a surprising result! So be sure to use
abbreviations that will never occur on their own, or even as part of
another word. One technique many people use to solve this problem is
to double the first or last letter, as in kmm for Keyboard Maestro. Anoth-
er is to add a slash (/) to the beginning of each abbreviation.
80
Note: Although I say “text expansion,” the very same feature can be
used for simple replacements, even if the replacement isn’t longer.
For example, if you frequently mistype “the” as “teh,” you could use
text expansion to replace the latter with the former—or you can
correct “MacWorld” to “Macworld” and “PhotoShop” to “Photoshop.”
Figure 28: Set up macOS text replacements here. This image shows
the window after numerous replacements have been added.
81
2. Click the plus button.
3. Type the text you’ll type in the left-hand (Replace) field, and then
type the text you want to end up with in the right-hand (With) field.
4. Press Return.
Although text replacement works well enough for what it is, this
feature has numerous limitations:
• It doesn’t work in all apps; the only way to know where it does work
is to look for the Edit > Substitutions > Text Replacement menu
command, make sure Text Replacement is selected, and then try
your abbreviations. (For example, it doesn’t work in BBEdit or
Word—but Word has its own built-in text-expansion feature.)
82
• You can’t configure the trigger characters that cause abbreviations
to expand.
So, if you like the idea of text expansion but find the Mac’s built-in
feature too limited, it’s time for a more powerful, third-party tool.
These four tools share many features in common beyond mere text
replacement—for example, all of them can:
• Insert the current date or time (or a portion of it, such as “Tuesday”)
• Ignore certain apps where you don’t want text expansion to occur
83
• Reposition the insertion point to any arbitrary location after
expanding text
These four utilities are much more alike than different, and most users
should be equally content with any of them. I will, however, point out a
few distinguishing characteristics:
Tip: The Smile blog has a fantastic post about how to perform Cur-
rency Conversion with TextExpander, with a little bit of AppleScript
and a small helper app.
84
characters can signal the end of a word. And unlike TextExpander
and TypeIt4Me, it currently has no iOS counterpart. At the end of
this book, there is a 30%-off coupon for Typinator.
The more time you spend working with a text-expansion tool, the more
ideas you’ll come up with for putting it to good use. Here are a few I
haven’t mentioned already:
Just to show you how this works, let me walk you through the steps of
creating and using an abbreviation in TextExpander:
2. In the main content area, type the text you want to end up with,
such as supercalifragilisticexpialidocious.
85
3. In the abbreviation field, type the abbreviation you want to use,
such as scfl. (Be sure not to reuse an abbreviation you used in
System Preferences > Keyboard > Text.)
5. Now open an app where you can type text (like TextEdit or Mail).
86
Automate the Finder
The Finder is a special app that runs all the time and lets you navigate
all the files, folders, and apps on your Mac. You use the Finder to
organize, tag, and locate files; connect to other devices on your net-
work; mount and unmount servers and external drives; and perform
numerous other activities that involve files, folders, and volumes.
The Finder is also the main place people go to open apps that don’t
appear in the Dock. When you want to launch an app, you might open
a Finder window, click Applications in the sidebar, scroll to the app
you want, and double-click it. Similarly, if you want to open a docu-
ment in its default app, you might dig through any number of nested
folders in the Finder and then double-click that document.
Since you use the Finder so much, it offers prime opportunities for
automation. For example, it’s possible to launch apps and open docu-
ments without clicking and scrolling through any windows. In a second
or less, while keeping both hands on the keyboard, you can open an
app or document without even knowing where it’s located.
In this chapter, I discuss how to get started automating the Finder
using Spotlight, and then I move on to more powerful third-party
utilities that let you do even more.
Tip: As you’re working in the Finder, don’t forget about the Mac’s
Quick Look feature. Just press Space with a file selected to see a full-
size preview instantly without having to open an app—many common
formats are supported. Quick Look also works in most launcher apps.
87
keyboard shortcut, type a few letters of the app you’re searching for,
and press Return to launch it as soon as it’s highlighted.
Spotlight isn’t perfect, by any means, but once you get the hang of it,
it’s a pretty good way to find stuff.
2. Begin typing an app’s name (Figure 29). If the app’s name is made
up of multiple words, you can type the first letter of each (such as ka
for Keychain Access); you can also type InterCapped letters, as in bc
for BusyCal. Wait while Spotlight searches. As it finds matching
items, it lists apps at the top.
88
3. If the app you want to launch is highlighted as the top hit, press
Return to launch it. If it’s not the top hit, you can either continue
typing to narrow down the search or press the ↓ key until the app
you want is highlighted. Then press Return.
The app opens. This works regardless of where the app is located on
your Mac.
You can use the same technique to open documents, Music tracks,
Contacts records, Safari history items, and so on. You can also use it to
look up words in the dictionary and to perform web searches.
Even if you restrict yourself to opening apps from the keyboard with
this method, Spotlight tends to be kind of slow. And because its results
change over a period of several seconds, it often takes that long to be
sure that the thing you want will still be highlighted when you press
Return. So you can’t blindly type in a few characters and trust that the
right thing will open.
89
But with a bit of extra software, all these problems can magically
disappear—and you can gain significant new capabilities.
Here are the sorts of things a third-party launcher can do that the
Spotlight menu can’t:
• Learn your preferences as you use it, so that your most frequently
used items automatically bubble to the top of the list (and therefore
require fewer keystrokes)—even if those items aren’t apps
90
Note: Keyboard Maestro (see Control Your Mac with Keyboard Mae-
stro) also has an app launcher that you can activate with a user-
defined keystroke, but I don’t include it in this list because it’s less
powerful and less convenient to use than standalone launchers—and
it doesn’t learn your preferences as you use it.
The typical way you use a launcher is much like the way you use the
Spotlight menu from the keyboard. Press Control-Space (or whichever
hot key you’ve selected) to open a window or other widget, and then
begin typing.
LaunchBar
I’ve used LaunchBar since 2002, and even though I’ve tried all the
other launchers (more than once), I always come back to LaunchBar
because it just feels right to me. It works the way I think (or vice versa).
And, you can save 20% on LaunchBar with the coupon at the end of
this book.
91
Figure 30: After activating LaunchBar with ⌘-Space (or a custom
keystroke), type a letter or two (M in this case) to see matching apps
and other items.
You don’t have to type the first letters of the name exactly; for example,
I type nw for Nisus Writer Pro and oo for OmniOutliner. If you type an
abbreviation and then select something other than LaunchBar’s top
pick, it remembers that, and as you use it, it molds its suggestions to
your actual usage.
LaunchBar has many other talents, too. If you press the hot key and
then start typing numbers, LaunchBar assumes you want to perform a
calculation, and lets you do so without any other preliminaries (just as
Spotlight does). You can also use a feature called Instant Send to do
interesting things with selected files or folders—for example, email
them, open them with a non-default app, or run an AppleScript on
them. I use LaunchBar for looking up contact phone numbers, tracks
in Music, and many other things. LaunchBar can also remember items
previously copied or cut to your Clipboard and recall them later.
92
Alfred
When you press Alfred’s hot key, a large floating window appears.
(Alfred uses Option-Space by default, an unfortunate choice since that
types a nonbreaking space in many apps.) Start typing the name of an
app, file, or other content, and Alfred displays matches immediately.
You can also type keywords to perform commands such as restarting
your Mac or hiding the current app. Alfred has hundreds of features
and nearly every aspect of the app is highly customizable.
Butler
Butler pops up a floating window when you press its hot key (Control-
Space by default), and as you start typing, the results initially look
much like those in the Spotlight menu. However, unlike Spotlight,
Butler can learn your favorite apps, files, and other items as you use it.
You can also trigger Butler with a menu, hot corner, or user-defined
abbreviation. Butler offers the usual range of launcher actions: opening
files and apps, searching the web, running AppleScripts, controlling
music playback, and so on. It also includes a clipboard history (see Use
a Macro or Launcher Utility).
93
Quicksilver
Quicksilver is a free (donations accepted), slick, and highly modular
launcher. It includes just a few built-in features, but you can add any of
dozens of free plugins to enhance the app with additional capabilities.
Some of these plugins provide controls for specific apps (Apple Mail,
Evernote, Google Chrome, Music, Safari, and others) while others add
lower-level features (such as image and text manipulation, access to
the windows and menus of open apps, calculations, a clipboard history,
and text manipulation).
Raycast
Raycast is the hot new thing. Superficially, it’s much like the others in
this list: you can quickly launch apps, control your music, perform
calculations, add calendar entries, and so on with just a few keystrokes.
It also includes a clipboard history, and offers a snippet feature for
expanding abbreviations (like TextExpander and similar utilities; see
Automate Text Expansion). Of course, it learns as you use it, too. As
with Alfred, the default keyboard shortcut to activate it is the unfortu-
nately chosen Option-Space, but you can change it.
94
Not only is Raycast impressive, it’s also undergoing rapid develop-
ment, something I can sadly no longer say for LaunchBar. So it has a
good shot at becoming my new favorite soon. Raycast is currently free,
and will likely always be so for individual users. Features for business
teams, and future capabilities such as Artificial Intelligence (AI)
features, may at some point require a fee.
A clever utility called Hazel does the same thing, except for files in the
Finder rather than for email messages. You can save 20% on Hazel
with the coupon at the end of this book. (And, you should find Hazel’s
built-in help especially helpful—I wrote it!)
In the Hazel app, you select a folder and then set up one or more rules
for it (Figure 31).
Figure 31: Rules in Hazel look and act much like rules in Mail—
except they target files rather than email messages.
Rules can look for conditions such as how recently a file was created or
modified, its name, its size, tags, and other attributes. When it finds a
match, Hazel can perform one or more actions such as applying a tag,
95
moving or copying the file into another folder, deleting the file, com-
pressing or decompressing it, importing it into Music or Photos (for
music and photos, respectively), displaying a notification, or running
an AppleScript or shell script.
Hazel can also keep your Trash from overflowing with old and/or large
files, help you completely remove all traces of apps you delete, and
remove duplicate files.
I’ll admit that the first time I heard about Hazel, I was afraid that it
would move things around without my knowledge, with the result
being that I’d lose (or at least lose track of) things rather than have a
tidier Mac. I mean, I put files in particular places for a reason, and I
didn’t want some smart-alecky app making up its own mind about
where things should go. But in fact, Hazel does only what you expressly
ask it to do. And if it makes you more comfortable, it can alert you
when it moves or deletes something so that there are never any sur-
prises.
• Add music files that appear in your Dropbox folder to Music. It can
delete the (now redundant) originals, too.
• Alert you when a shared folder changes (say, for a project you’re
working on with someone else).
96
It’s easy to get carried away with a tool like this, but I prefer to think of
it as a way to automate a few specific file-management tasks that
would otherwise require my time and attention.
97
Supercharge Your
Clipboard
Cut, copy, paste. You’ve probably done those things thousands of times
without even thinking about your clipboard, the temporary storage
space macOS uses to hold whatever you’ve cut or copied. The Mac’s
built-in clipboard is boring, but numerous utilities can supplement or
replace it with powerful new capabilities that will save you time and
effort.
With one of these utilities installed, you’ll never again have to worry
about your Mac crashing right after you’ve cut or copied something but
before you paste it. You’ll also be able to see and use things you copied
to your clipboard hours or days ago, change the clipboard contents
between the time you copy it and the time you paste it, and more.
98
paste the just-previous item from my clipboard history—that way, I
can easily copy two different things and then paste them both
consecutively.)
Still can’t quite imagine how you’d use a clipboard utility? Let me give
you some concrete examples of how I do:
• Copy the title of an article on the web, copy its URL, and then paste
the two in sequence without having to switch back to a browser
• Copy the URL for a product at Amazon and paste it with my affiliate
link baked right in
99
• Copy raw HTML code but paste it with Markdown formatting, or
vice versa
• Copy a large chunk of text and paste it with any duplicate lines re-
moved
The last three items in this list are examples of filtering, which saves a
tremendous amount of tedious work.
I’m all in favor of multipurpose tools, and if one of these meets your
needs, that may be the best solution for you. On the other hand, if you
need extra features (or don’t have a suitable macro or launcher utility),
I’ll tell you about several standalone clipboard tools ahead in Use a
macOS Clipboard Utility.
Keyboard Maestro
I talk about Keyboard Maestro’s macro capabilities later, in Control
Your Mac with Keyboard Maestro; there’s also a coupon at the end of
the book for a 20% discount. For now, I want to mention its clipboard
capabilities:
• Access to persistent clippings that you can see and use even after
restarting your Mac
100
• User-definable hot keys for working with clipboards
Note: Keyboard Maestro, like many of the utilities in this book, uses
the term hot key (or hotkey) as a synonym for keyboard shortcuts.
All this is extremely snazzy, and it’s nearly everything I could want
from a clipboard utility. Keyboard Maestro doesn’t, however, let me
manually edit a clipboard, nor does it offer a way to sync my clipboard
history across Macs (although it can send a clipboard from one Mac to
another).
Launcher Utilities
In the previous chapter, I told you how to Use a Third-Party Launcher
to do things like opening apps, playing tunes, and performing calcula-
tions. All the launchers I mentioned—LaunchBar, Alfred (with the
optional Powerpack), Butler, Raycast, and QuickSilver—also keep
clipboard histories, so you can copy multiple things and then paste
earlier clippings. But, they also offer some other clipboard features
worth mentioning.
101
LaunchBar, Alfred, and Raycast can paste a clipping as plain text,
preserve clippings when you restart your Mac, and merge whatever
you’re copying with what’s already on the clipboard. In addition, Alfred
lets you name your clippings. Butler refers to clipboards by their
technical name, “pasteboards,” and offers persistent clippings, named
clippings, and user-definable hot keys for working with clipboard
contents.
• Copy’Em
• CopyClip 2
• CopyLess 2
• CopyPaste Pro
• Paste
• Pastebot
Note: Just a quick comment about Paste, newly added to this list: it
can sync your clipboard history across your Macs, iPhones, and iPads,
a rare and wonderful capability!
102
Automate Individual Apps
Later in this book, I talk about systemwide automation technologies
built into macOS like Shortcuts, AppleScript, and Automator, which
can automate the actions of individual apps. But there’s often a bet-
ter—or, at least, more thorough—way of doing that within an app itself.
That’s the topic of this chapter: using apps’ built-in automation capa-
bilities.
Due to the breadth and depth of in-app automation features, I can only
provide an overview, basic instructions, and a few examples. You’ll be
able to accomplish some basic tasks and discover how to learn more.
103
VBA from Office 2008 for Mac, but brought it back in Office 2011. It’s
still there in Office 2021 (also available as part of an Office 365 sub-
scription), and presumably, it will be in future versions too. (Microsoft
Office also has excellent AppleScript support, which is an alternative
way to accomplish many of the same tasks.)
Note: In Office for Mac, only Word, Excel, and PowerPoint support
VBA.
What can you do with an Office macro? The sky’s the limit, but here
are a few simple examples, any of which could be done with a single
click or keystroke:
• Reformat a table
However, there’s a sneaky way to get your foot in the door—to write a
VBA macro without knowing any VBA at all. Office lets you record
macros—that is, turn on recording, do some stuff while Office watches,
104
and then turn off recording. Office then attempts to make a VBA macro
out of whatever you just did, which you can then replay at will. Some-
times these macros work fine as is; sometimes they require fiddling;
and sometimes you’re out of luck.
3. In the dialog that appears (Figure 33), give your new macro a
name (like Test) and click OK.
Figure 33: In this window, you define a new macro before you begin
recording it.
105
Tip: If you want to assign a keyboard shortcut to your macro now,
you can. Before you click OK in this dialog, click Keyboard, press the
desired keyboard shortcut, and click OK. But you can also Assign a
Keyboard Shortcut to a VBA Macro later.
a. Type the word First, press Tab, type Second, and press Return.
f. Select Table > Convert > Convert Text to Table and click OK.
That’s it; you’ve recorded a macro. In theory, you can replay the exact
actions you took again, at any time, in any document. So let’s try.
2. Select the macro you just recorded (it will likely be selected by
default).
3. Click Run.
Curious to know what your macro looks like in VBA? Choose Tools >
Macro > Macros, select your macro, and click Edit. You see something
like Figure 34.
106
Figure 34: Here’s what the macro we just recorded looks like in
Visual Basic.
Beautiful, isn’t it? No, of course not, but if you look carefully, you can
probably make out approximately what the commands do. If you were
so inclined, you could edit the macro right here—for example, substi-
tute different words in the Selection.TypeText Text: lines.
3. In the Commands list on the right, select the macro you want to
assign a keystroke to.
5. Press the key combination you want to use. (See the sidebar Use
Multi-Key Shortcuts in Microsoft Word, below, for a special tip.)
107
6. Click Assign.
From now on, you can activate your macro with that keyboard short-
cut.
108
wrote years ago to paste whatever’s on the clipboard as plain text, so
that it assumes the style of the surrounding text. If you were to do this
manually, the process would be: Choose Edit > Paste Special, select
Unformatted Text, and click OK. A macro can reduce all that to one key
combination!
2. Type a new macro name (we’ll use PastePlainText) and click Create.
3. In the window that opens, you’ll see a placeholder template for your
new macro, like so:
Sub PastePlainText()
'
' PTT Macro
'
'
End Sub
4. Paste or type the macro commands. For this example, enter the
following in the blank space before the End Sub line:
Selection.PasteSpecial Link:=False, _
DataType:=wdPasteText, Placement:=wdInLine, _
DisplayAsIcon:=False
109
5. Your final macro should look like this:
Sub PastePlainText()
'
' PTT Macro
'
'
Selection.PasteSpecial Link:=False, _
DataType:=wdPasteText, Placement:=wdInLine, _
DisplayAsIcon:=False
End Sub
6. If you like, you can remove the lines starting with an apostrophe;
those are comment lines that don’t affect the macro’s function.
Your macro is now ready to run. You can run it using Tools > Macro >
Macros, or assign a keyboard shortcut to your macro (such as ⌘-Shift-
V) following the instructions in Assign a Keyboard Shortcut to a VBA
Macro.
Note: I said I “wrote” this macro years ago, but, in fact, I cheated—I
recorded myself following the steps I spelled out a moment ago, and
this macro is what I got!
110
Learn More about VBA
To get help writing and editing VBA macros, try these sites:
• Microsoft’s Office 2016 for Mac pages Create, run, edit, or delete a
macro, Automate tasks with the Macro Recorder (for Excel), and
Create a macro in PowerPoint
• Microsoft’s Getting Started with VBA in Office for Mac 2011 page
(which still largely applies to later versions of Office)
One of the reasons I like Nisus Writer Pro so much is that it’s chock full
of automation features that make my writing faster and more efficient.
In this chapter I want to look at three of them: macros, multi-key
shortcuts, and automatic numbers and cross-references.
111
Nisus Writer Pro includes over 50 preinstalled macros on the Macro
menu (or its submenus). Choose any macro name to run it. Some
macros assume you have text selected first; if you try to run a macro
and it won’t work in the current context, it’ll either beep or display an
error message.
• Macro > Editing > Quote Selection: Select some text and run
this macro to put quotation marks around it.
Take Control authors and editors have lots of specialized macros that
aid in our workflow, such as:
If you’d like to find more macros you can install and run yourself, visit
Nisus Software’s Nisus Writer Pro Macros forum. (That’s also a good
place to find tips on writing your own macros.)
112
Create Macros in Nisus Writer Pro
To make your own macro in Nisus Writer Pro, follow these steps:
1. Choose Macro > New Macro. A new window (which looks just like a
regular document window) opens.
2. Type or paste the text of your macro. For illustration purposes, try
this:
3. Choose Macro > Save as Macro. Give your macro a name (such as
Hello) and choose a location. The ideal destination is your default
Macros folder, and you can choose or change that location using the
Macro > Choose Macros Folder. (If you’re uncertain which folder is
currently the default for saving macros, choose Macro > Show
Macros Folder in Finder, and that window opens.) If you save a
macro in the default Macros folder, it will automatically appear on
the Macro menu; if you save it anywhere else, you’ll have to go
through extra steps (which I don’t cover here).
Now, to run your macro, choose its name from the Macro menu:
Macro > Hello (or whatever you named it). You should see a little
dialog with the text “Hello, world!” Click OK to dismiss it.
If you want to view or edit a macro that’s already in the Macro menu,
the easiest way to do so is to hold down the ⌘ key while choosing the
macro from the menu—instead of running, it opens in a new window.
You can edit it there; after you save it, choosing the macro name from
the Macro menu in the normal way runs your updated version.
I gave you a one-line example macro, but what else can you put in a
macro? I’m glad you asked. Let me begin with the easiest approach to
writing your own macros.
113
Simple Macros
First, the bad news: unlike Microsoft Office, Nisus Writer Pro has no
recording capability—it can’t watch what you do and make a macro out
of that for you. But now, the good news: it’s way easier to write macros
for Nisus Writer Pro than for Word!
How easy? For the simplest things, like running menu commands, you
just type a command (as it appears on a menu) on a line by itself. If the
command includes an ellipsis (…), you can leave that off.
So, here’s a macro that turns the selected text bold, makes it 18 points,
and then copies it to the clipboard:
bold
18
copy
Tip: When trying the macros from this book in Nisus Writer Pro,
either retype them or paste them by choosing Edit > Paste > Paste
Text Only (⌘-Shift-V). If you paste styled text into a macro, you
might encounter inscrutable error messages.
A macro can do lots of things that aren’t merely menu commands, too.
Want it to type the text “Hello, world!”? Do it like this:
114
I gave find all "Apple" as an example, but one of the most useful
things you can do in a macro is automate more elaborate find-and-
replace procedures—or a series of them. Nisus Writer Pro, like a few
other apps mentioned in this book, lets you use a pattern-matching
system known as regular expressions for finding and replacing text. (It
can take those expressions even further by applying styles to portions
of the expressions—a highly unusual feature.)
Note: The letters E and a at the end tell the macro to perform the
find and replace with two special options—using regular expressions,
or PowerFind Pro, as Nisus Writer Pro calls them (E), and replacing all
the occurrences in the document (a). Those special characters are
case-sensitive.
This one finds any sequence of two capitalized words and underlines
just the first one:
Complex Macros
It’s easy to make a macro that executes a series of simple commands,
but you may want to do fancier things. You may want to use variables,
arrays, objects, functions, loops, if/then/else conditionals, mathemati-
cal functions, string manipulation, and other sorts of things you’d
normally find in a “real” programming language. All that, and much
more, is well within the purview of Nisus Writer Pro macros too!
I’ve written many of these complex macros that involve serious pro-
gramming, and while I can say confidently that it’s not nearly as bad as
working in VBA or even AppleScript, it’s different. And the way you
115
construct the commands and routines to do these nifty things is far
from obvious.
Unfortunately, there’s not room here for me to get into the finer points
of the language. You can get some guidance from the Nisus Writer Pro
macro reference—choose Help > Macro Language Reference in Nisus
Writer. That document contains all (well, nearly all) of the commands
in the language, and a number of examples. But candidly, it wasn’t
written for the layperson. The macro language itself isn’t unduly
complicated, but the documentation makes it seem harder than it is.
Someone ought to write a better guide. Maybe one day, somebody will.
For example, there’s a menu command that capitalizes the first letter
of each selected word: Edit > Transform Text > To Capitalized. You
could assign ⌘-Control-Shift-C to it, but that’s hard to remember.
What’s easy to remember is ⌘-C-A-P. That is, hold down Command
while typing C, and then A, and then P. Cool, no?
116
• Save As PDF: ⌘-P-D-F
I’m sure you get the idea. Here’s how you set up a shortcut:
2. In the first column, select the menu where the command is found.
3. In the second column, select the command (or, if it’s not on the top
level of the menu, navigate through the submenus to select it).
Tip: You can also create menu keys for individual preference panes
by navigating to Nisus Writer Pro > Settings/Preferences > pane
name. I set up ⌘-M-K to take me directly to the Menu Keys pane!
117
4. Click in the field on the rightmost pane.
6. Click Set.
118
That part is useful but not terribly unusual; most word processors can
do something of the sort. Where it gets interesting is cross-references
to the automatic numbers. For instance, I might have a graphic that’s
labeled “Figure 12,” and near it I say, “see Figure 12.” I want that
reference to update automatically if, later on, that graphic turns out to
be Figure 15 instead. So instead of just typing the reference, I insert a
cross-reference to the text of that automatic number. As the figure
number itself changes, so does the textual cross-reference!
OK, I’m oversimplifying slightly. For performance reasons, Nisus
Writer doesn’t automatically update cross-references immediately
when their references change, though it does so when you open a
document, print it, add or update a table of contents, and at certain
other times. If cross-references ever appear to be out of date, you can
force an immediate update by choosing Tools > Automatic Content >
Update All Stale Content. It goes without saying that you can and
should assign a keyboard shortcut to that command! Mine is ⌘-USC.
Note: Nisus Writer Pro can do this trick with lots of things, not just
automatic numbers. Any time text in one part of your document
changes, cross-references to that text elsewhere can update them-
selves. (That’s what I’ve done with all the links in this book to other
topics—if I rename a heading, the text of the link updates too.)
1. Begin by creating a new list style, just for figure numbers. In a Nisus
Writer Pro document, choose Format > Lists > Edit List Styles.
2. Click the plus button at the bottom and choose List Style from
the pop-up menu. Name it Figures, leave the Kind set to Numbered,
and click Create.
3. In the sample text area on the right side of the window, select
Level 1. Then, in the Lists palette (if you don’t see it, choose
Window > Palettes > List), click in the Before Text field and type
119
Figure followed by a space. In the After Text field, type a colon (:)
followed by another space (Figure 36).
Figure 36: Your list style definition should look something like this.
5. Insert a graphic (or just type some text, pretending that it’s a graph-
ic) followed by Return. Type a caption in the paragraph beneath
that line, such as This is the caption.
7. Repeat steps 5 and 6 a few times, so you have three or four num-
bered figures. (If you press Return at the end of a list paragraph,
Nisus Writer Pro assumes you want that next paragraph to be in list
120
style too. You can override this by choosing Format > Lists > Use
None, or by applying a paragraph style, such as Normal.)
You should see that the caption’s figure number updates itself, and the
reference to that caption in the text updates itself to match! (And, if
that doesn’t happen immediately, remember that you can force an
update with Tools > Automatic Content > Update All Stale Content.)
• Adobe Acrobat Pro and Photoshop: Both of these apps let users
create actions, which are basically macros—sequences of predefined
steps that alter a document or image in some way. You can also
install actions other people have written, some of which are fantas-
tically sophisticated.
121
• BBEdit: This splendid plain-text editor, which is designed mainly
for programmers and web designers but has also found a following
among authors, has a couple of great automation features. Text
factories are sequences of actions (such as find-and-replace–based
on regular expressions, natch; sorting lines; changing case; and
running shell scripts or AppleScripts) that you can save and run
repeatedly with a couple of clicks. BBEdit also has a Text > Apply
Text Filter submenu, which lists not only your text factories but also
individual Automator workflows, AppleScripts, and shell scripts
that can process and modify your text.
122
vocals, add effects, and mix audio every which way. It can memorize
all your changes in real time—adjustments to volume, panning,
equalization, effect levels, and other parameters for each individual
track—and repeat those changes every time you record or play back
your music.
Among other tasks, I use Panorama for tracking royalties for Take
Control authors. It’s an insanely powerful and flexible tool that, over
time, has enabled me to automate some of the most tedious parts of
my job. I can’t say enough good things about it.
123
Automate Email
Probably 90% of the time I spend using my Mac involves one of four
apps: a text editor, a word processor (I am an author, after all), a web
browser, and an email client. I send and receive large quantities of
email, and I use email far more frequently than phone calls or instant
messaging—maybe even more than speaking. It’s my main means of
communication.
If you’re trying to keep your inbox under control, rules are one of the
most powerful tools available. Because I presort my email with rules,
tons of messages that don’t require immediate attention never reach
my inbox at all; instead, they’re safely shunted to other mailboxes
where I can review them at my convenience. Creating a good set of
rules requires a bit of thought and effort, but once you’ve done that,
those rules operate invisibly in the background.
Rules are a very powerful organizational aid, but making them is just
one aspect of automating email. You may also want to simplify the
manual filing of messages that aren’t picked up by rules, add plugins
that automate various other email actions, or use smart mailboxes as
search shortcuts. I cover all those activities in this chapter.
124
Use Server-Based Rules
Rules can operate either in your email client (such as Apple Mail) or
directly on your incoming mail server. The huge advantage to server-
based rules is that they can presort messages before you see them, even
if your Mac email client isn’t running. That greatly reduces the amount
of mail you need to deal with on your iPhone or iPad.
Although the details vary from one provider to the next, rules always
contain one or more conditions (things to search for) and then, when
there’s a match, perform one or more actions. For example, look for
any message from a certain address (say, a company’s PR department)
and file it in a Newsletters mailbox.
125
Tip: A service called SaneBox will, for a monthly fee, perform an
automated analysis of your incoming messages, determine what’s
likely to be less important to you, and move it out of your inbox
(providing only a brief summary). It can do other tricks too, such as
providing server-based rules—even if your email provider doesn’t
offer them—and automatically moving attachments to cloud storage
such as Dropbox. Although SaneBox doesn’t fit my model of email
management, many people find it immensely helpful.
Tip: For help writing an AppleScript that will be used in a Mail rule,
open Script Editor (in /Applications/Utilities) and choose File >
New from Template > Mail > Mail Rule Action. That’ll open a template
with example code to get you started.
126
Create a Rule
To create a basic rule, follow these steps:
A dialog appears showing the condition(s) the rule checks for and
the action(s) Mail takes if the conditions match (Figure 37).
Figure 37: Use this dialog to specify the condition(s) and action(s)
for your Mail rule.
4. From the provided pop-up menus, choose the action you want the
rule to perform on a message if (and only if) it matches the condi-
tion you just specified. (Just ahead I explain how to handle rules
that include multiple actions.)
127
[Set Color of Message] [of background] [Blue]
[Reply to Message] (Click the button and fill in your stock reply)
[Mark as Read]
5. Click OK.
An alert appears, asking if you want to apply your rules (including
the one you just created) to messages in selected mailboxes.
6. Click Apply or Don’t Apply, as you prefer. I generally suggest click-
ing Don’t Apply, because applying new rules to messages in open
mailboxes can have unexpected and potentially unpleasant results.
7. If you’re finished creating rules, close the Preferences window.
Your new rule now checks all incoming messages for matches and
performs the actions on them that you set.
Rule Examples
One of the most common uses for rules is to process messages that
follow predictable patterns. If you find yourself filing, flagging, or
deleting a certain type of message at least once a week, you can save
time and effort by setting up a rule to do it for you. Examples are
mailing lists, utility bills, bank statements, newsletters, travel discount
offers, and jokes forwarded by friends or family members.
TidBITS issues:
If Any of the following conditions are met:
128
Perform the following actions:
129
Automate Apple Mail with Extensions or
Plugins
For many years, developers were able to add features to Mail for
macOS by writing special apps called plugins. Plugins could be quite
powerful, altering the way Mail receives and sends messages, adding
useful new interface elements and menu commands, and remedying
missing or poorly implemented features.
Note: Much of the text in this section was adapted from my book
Take Control of Apple Mail.
Apple never seemed to love plugins, for whatever reason, offering only
grudging support. Then, with Monterey, Apple announced an entirely
new architecture for third parties to interact with Mail: extensions,
which developers can create using a framework called MailKit. (As a
user, it’s unlikely you encounter that term.) Unlike plugins, Apple
embraced extensions and gives them explicit approval. Sadly, exten-
sions are more limited than plugins, preventing many types of func-
tionality available in third-party plugins, such as adding tags to mes-
sages, applying rules to outgoing messages, and changing signatures.
Warning! While you can use both plugins and extensions in Mon-
terey and Ventura, any plugins you had installed under Ventura or
earlier no longer function once you upgrade to Sonoma; you must
replace them with extensions or live without those features.
130
app associated with the extension and configure any additional set-
tings it may offer.
Here are a few examples of Mail add-ons that are packaged as exten-
sions; some are also available as plugins for earlier versions of Mail:
131
Lifter, which automatically uploaded attachments to cloud storage,
replacing them with a link, much like Mail Drop does but with
vastly greater flexibility. Although that capability sadly no longer
exists in the current version, Mailbutler still offers the following
wide array of features:
132
‣ Undo sending a message within a short period of time
• SpamSieve: If you find that Mail’s built-in Junk Mail filter makes
too many mistakes, even after training, and server-side filtering is
unavailable (or no more successful), SpamSieve is the tool you
want. I’ve tried a bunch of spam filters for Mail, and SpamSieve is
by far my favorite. I’ve relied on it for many years, and although it
isn’t perfect, it does a much better job of learning as you use it than
Mail’s built-in filter does. SpamSieve costs $39.99.
Tip: Mail lets you define signatures that appear at the bottom of each
message (see Mail > Preferences > Signatures). Although Mail
provides a decent level of customization, it doesn’t approach what
you can get if you Use a Third-Party Text Expansion Utility instead.
133
Search Faster with Smart Mailboxes
Back in Create and Use Smart Containers, I explained what smart
mailboxes are (basically, saved searches) and how to create them. If
you click a smart mailbox icon, it should initially display exactly the
same messages as the search you used to create it. As you receive and
delete messages that meet your criteria, the list will change.
Make sure you select Include Messages from Sent to pick up your
messages to this person. For even better results, choose View >
Organize by Conversation to display all your exchanges in a thread-
ed conversation.
• What to do if All and Any aren’t smart enough: If you use the
[Message is in Mailbox] condition, the contents of one smart
mailbox can depend on another smart mailbox. This is handy when
134
you have so complex a set of conditions that Any and All are too
limited. For example, you might have one smart mailbox that lists
messages from any (“Any”) of several friends, and another that lists
messages that are both in the first smart mailbox and (“All”)
marked as high priority.
• Each incoming account type (Exchange, POP, and IMAP) has its
own distinct rules.
• You can also create rules that apply to outgoing messages. (In Mail
that requires a third-party plugin).
• In addition to rules that match Any and All conditions, you can
specify negative matches—“Unless any conditions are met” and
“Unless all conditions are met.”
135
3. Click the plus button.
4. Enter the desired condition(s) and action(s), give the rule a name,
and click OK.
• Airmail
• Inky
• MailMate
• MailMaven
• Mail Pilot
• Postbox
• Thunderbird
136
Automate the Web
You might not think of web browsing as an activity that requires
automation. You follow links, you read articles, watch cat videos,
maybe make the occasional purchase, but that’s all inherently manual,
right? After all, I don’t want my Mac to read Facebook posts for me or
play games behind my back.
But in fact, the web offers numerous opportunities for shortcuts and
simplification. For example, every time you’re asked to supply a
username and password, a credit card number, or a mailing address,
your Mac can do that for you—no typing (or memorizing) required.
And then, looking more generally at cloud services that have a web
presence, there are tons of opportunities for connecting things. Per-
haps you want to post photos to Facebook after they appear in a shared
Dropbox folder. Or save links from your favorite tweets to Instapaper.
Or see an alert in the evening if tomorrow’s weather forecast calls for
rain. All sorts of things that can occur in one cloud service can trigger
events in other cloud services—an area ripe for automation.
137
The Mac version of Safari (like nearly all web browsers) can automati-
cally fill in your contact information (name, address, phone number,
and so on), as well as usernames and passwords, on web forms. Safari
uses the Mac’s systemwide keychain mechanism to securely store the
portions of this data that aren’t already in your Contacts app.
138
Note: You can read more about passkeys in this TidBITS article or in
my book Take Control of Your Passwords.
One iCloud Keychain is enabled and syncing your data, you must next
configure Safari to use its features. Go to Safari > Settings/Prefer-
ences > AutoFill and make sure the checkboxes are selected for each
type of data you want to autofill—the two options relevant to iCloud
Keychain are “User names and passwords” and “Credit cards.” (If you
like, you can also select “Using information from my contacts” or
“Other forms”; I discuss these later.) Then click Passwords at the top
and, if the screen says “Safari passwords are locked,” fill in the pass-
word for your macOS user account and press Return.
139
Autofill Secrets
Apple provides support for two intertwined account validation secrets:
passwords and verification codes. Nearly all sites require passwords
for login; an increasing number allow or require a verification code.
Autofill Passwords
After you load a login page for which you’ve already stored credentials
in your iCloud Keychain, you can do any of the following to fill your
credentials:
• Press ⌘-Shift-A
• Click in the Username or Password field and then click the creden-
tials you want to use on the pop-up menu that appears
Safari fills in the username and password fields for you—all you need
to do then is click or tap the Login button or its equivalent.
If you’ve stored more than one set of credentials for a site—for exam-
ple, if you have two different accounts for Microsoft or Google—first
delete the credentials Safari has autofilled, if any. You can then click in
the username field to display a pop-up menu (Figure 39). If the login
shown is not the one you want to use, click “Other Passwords for URL”
and then choose the one you want to fill in your credentials.
140
Figure 39: If you have multiple credentials for a site, click or
tap in the username field, then click the “Other Passwords for…”
option to display other matches.
If Safari autofills a set of credentials and it’s not what you want, delete
them and try clicking the username field again. If they still don’t
appear (for example, because the domain names don’t match exactly),
click Other Passwords. In the dialog that appears, locate the account
you want (manually or using the Search field). Select it and click Fill.
141
second-factor authentication at a website or within an app and then
generating a unique time-based code that only a device possessing the
seed could provide.
To use verification codes as part of logging in, after providing your user
name and password, tap a field or click in a field that prompts for the
code. Safari automatically generates a code tied to the website’s ad-
dress and lets you fill it in as Safari does for passwords.
If you already have credentials stored for the site and you want to store
an additional username/password combination, first delete the cre-
dentials Safari has autofilled. Then enter the new credentials, log in,
and click Save Password when prompted.
142
Generate a Random Password
When you’re asked to register on a website and create a new password,
iCloud Keychain can generate a unique and random one for you and
store it automatically. Follow these steps:
3. Click the key icon and choose Suggest New Password from the
pop-up menu.
When you submit the form, Safari saves your credentials for the site
without any additional steps.
143
Store and Enter Credit Card Numbers
Credit cards work much like passwords—if you type or paste a credit
card number and its expiration date into blank fields in a web form
and submit it, Safari prompts you to save the credit card number in
your iCloud Keychain.
When it’s time to fill in a stored credit card number, click in the Credit
Card Number field and choose the desired credit card from the pop-up
menu. If you have more than one credit card stored, Safari displays a
pop-up menu from which you can choose the one you want to use, just
as when filling in your username and password on a site for which you
have multiple sets of credentials.
Tip: Pay attention when you use this feature, to make sure that it
doesn’t autofill unwanted data, such as an old coupon code in an
online shopping cart.
Later, if you want to fill that in on the same site—or if you want to fill
in your contact information—you have two choices:
• Start typing your contact information in any form field. When Safari
sees that it matches corresponding information from your card in
Contacts, it pops up a little card icon labeled with your name. Click
this icon or press the ↓ key to select it, and then click AutoFill (or
press Return) to fill in the rest of the form.
145
• Autofill credentials in other macOS browsers (such as Google
Chrome and Firefox)
• Store and fill multiple sets of contact data (such as home and work)
• Provide a friendlier interface for viewing and editing data than what
Apple offers
For all these reasons, although I use and appreciate iCloud Keychain, I
rely more heavily on a password manager called 1Password. It syncs all
my data amongst my Macs and iOS/iPadOS devices, as well as Win-
dows and Android devices. It has lots of useful organizational features.
And, it gives me a greater feeling of control over my passwords than
iCloud Keychain does.
Tip: I like 1Password so much I wrote a book about it: Take Control
of 1Password. If you choose to use 1Password, you may find that
book helpful in getting up to speed.
However, 1Password is not by any means the only game in town. Other
third-party password managers that have most of the same features
(and thus, the same advantages over iCloud Keychain) include Dash-
lane, RoboForm, and Bitwarden. I’ve tried them all and would happily
recommend any of them.
146
Tip: If you want to automate a series of operations on webpages,
such as logging in, filling in forms, and searching, you can use Key-
board Maestro (see Control Your Mac with Keyboard Maestro).
More specifically, I use the term “cloud” to refer to storage, apps, and
other services made available over the internet as a replacement for
similar products that would otherwise run on local devices or require
managing resources on a server. Such services are provided by large,
distributed computer networks rather than individual servers, adding
another stratum to the cloud metaphor.
A consequence of this cloud craze is that you can end up with dozens of
accounts with cloud services that partially overlap in capabilities. Yet
for the most part, these services don’t communicate with each other.
The result is that you may end up spending a lot of time taking a file,
photo, or piece of information from one cloud service and moving or
posting it to another service.
Let me give you some concrete examples of how multiple cloud ser-
vices can be connected and automated:
147
• Post an Instagram photo and have it automatically sent to Flickr
too.
Got the idea? Let’s look at three sites that let you do those sorts of
things.
IFTTT
IFTTT (for If This, Then That) is the best-known and most popular site
in this category. The name describes the basic concept: you create two-
part recipes called applets that say: If this happens (in one cloud
service), then do that (in a second service). These applet formulations
are a bit like email rules, except that, in their default representation
there’s always exactly one condition and one action—simple.
What services can you connect? Why, there several hundred of them,
which IFTTT refers to as “channels,” covering almost every major
cloud storage platform (Box, Dropbox, Google Drive, OneDrive…),
social network (Facebook, LinkedIn, Discord, Foursquare…), and
photo site (Flickr, Instagram, 500px…), plus iOS/iPadOS data (con-
tacts, location, notifications, photos, reminders), email, SMS, blog
platforms, news sites, home automation tools, and even things like the
date, time, and weather. The list is growing all the time.
IFTTT provides many prebuilt actions; you can also build your own,
use actions other people have created, or edit an existing applet to
meet your needs.) Here are a few examples of prebuilt actions:
148
• Automatically post a reminder to a Slack channel 15 minutes before
a calendar event starts.
As you see, applets are customizable to include things like time, date,
and location, among other attributes.
IFTTT is free for personal use. After signing up for an account, you
activate whichever channels you’re interested in by signing in to the
relevant accounts. Then you can choose from a prebuilt applet, or
concoct your own as follows:
1. Click your avatar in the upper-right corner and then click Create
from the pop-up menu.
3. Click a trigger channel—where you look for the new piece of data
that will kick off the recipe.
That’s it! Your recipe now runs by itself, automatically taking the
action you specified when the trigger occurs.
149
Tip: For a great example of using IFTTT with iOS notifications (via
iCloud), read Ben Waldie’s Macworld article Power tools: Make events
on your Mac trigger iOS notifications.
If you need more power, however, you can turn to IFTTT Pro, a paid
service that lets you create applets with greater complexity. For exam-
ple, an applet can have not just one action but several—If this, then
that and that and that. And, the starting condition can run through a
filter that you write (using JavaScript) that overrides or skips actions
depending on certain variables.
Zapier
Unlike IFTTT, Zapier is designed primarily for business. As such, it
integrates with a much larger number of cloud apps and services,
including many that are strictly for enterprise use. Zapier refers to its
automations as Zaps. In the basic, free plan, you can create Zaps with
only two steps (a trigger and an action, just like IFTTT’s basic applets),
using a subset of the available cloud services. To access the full range
of services and multi-step Zaps, you’ll need a paid plan; prices start at
$19.99 per month.
• Copy new Facebook Lead Ads leads into Zoho CRM as leads.
If those names don’t mean anything to you, don’t worry! You’re proba-
bly just not the target audience for Zapier, and IFTTT will likely be
more suitable for your needs.
150
Discover Other Web Automation Options
Connecting cloud services is fantastically useful, but sometimes you
may need something a bit simpler and more elegant. For example, you
might want to monitor the web (as a whole) for new pages on a topic of
interest, or monitor a specific page for changes.
To use Google Alerts, fill out a form with your search query (just as if
you were doing a regular Google search), click Show Options, and fill in
a few other details—most crucially, your email address (Figure 41).
The current results of your query appear beneath the form. Click
Create Alert, and you’re done—you’ll get the results automatically.
151
Figure 41: Create a Google Alert by filling out this form.
You can go back to the Google Alerts page whenever you like to add,
remove, or modify alerts. Ideas for Google Alerts:
• Google yourself and find out when people are talking about you.
152
When a page changes, I check to see if the change is relevant to my
table, and if so, I update the table accordingly.
Tip: If you do use a service like this, do yourself a favor and set up a
rule in your email client (see Automate Email) to file all those change
reports into a special mailbox. They tend to accumulate over time!
• Find out the second any new Take Control book is published—even
if you’re not on our mailing list!
153
Automate Backup and
Syncing
Anyone who has followed my writing for Macworld, TidBITS, or Take
Control Books over the last decade is undoubtedly aware of my passion
for good backups. I’ve written several books (including Take Control of
Backing Up Your Mac) and lots of articles on the topic, and I preach
about the importance of backups at every opportunity.
In this book, I’m not going to try to convince you to back up your Mac;
I’ll take for granted that you already know that’s a good idea. Instead, I
want to focus on automating backups. Believe it or not, there are still
people who back up important files by dragging them to another disk
once a day. Still others use backup software to do the job, but they back
up only when they remember to run that software.
154
Run Backups Automatically with Time
Machine
Time Machine is the backup feature that Apple built into macOS. It’s
not necessarily the best backup tool, but it’s reasonably good. Most
importantly, it’s extremely easy to set up, making it the path of least
resistance for many users.
If you haven’t already set up Time Machine and would like to—or if you
configured it but turned off automatic backups—keep reading.
A dialog appears (Figure 42), listing all local and network volumes
eligible to be a destination disk and the amount of free space on
each local disk.
155
Figure 42: Available local and network volumes appear in this
dialog; select the one you want to use and click Set Up Disk.
3. Select a volume and click Set Up Disk. Another dialog (Figure 43)
appears.
156
4. Optionally, but strongly recommended, leave Encrypt Backup
selected, enter and repeat a password, and enter a hint. To forgo
encryption, turn off Encrypt Backup.
5. For local volumes only, a Disk Usage Limit control also appears. If
you’re content with using the entire volume for Time Machine
(preferable in most cases), leave Disk Usage Limit set to None.
However, if you want to use only a portion of the volume for Time
Machine and leave extra space for other uses, select Custom and use
the slider to specify the maximum amount of storage space your
Time Machine backups can occupy.
6. Click Done.
Normally, Time Machine then runs hourly, but you can change the
frequency if hourly backups are too frequent for your needs. To do this,
click the Options button in System Settings > General > Time Machine
and choose an option from the “Back up frequency” pop-up menu:
Manually, Automatically Every Hour (the default), Automatically
Every Day, or Automatically Every Week.
A dialog appears (Figure 44), listing all local and network volumes
eligible to be a destination disk and the amount of free space on
each local disk.
157
Figure 44: Available local and network volumes appear in this dialog
(specifics vary according to your version of macOS); select the one
you want to use and click Use Disk.
You can turn off Time Machine temporarily if need be, but please don’t
leave it off. Remember, backups are most valuable when they’re
automatic!
158
During each of Time Machine’s hourly runs, it backs up only the files
that have changed since its previous run. If an application stores its
data as a package (that is, a folder that looks like a file in the Finder),
Time Machine backs up only changed items within the package.
(Among many others, Photos, Keynote, GarageBand, and DEVONthink
use packages for their data.)
1. In the Finder, make sure the window that contains the item you
want to restore (or the one that used to contain it, if it’s been delet-
ed) is frontmost—you can verify this by clicking anywhere in the
window.
2. Click the Time Machine icon in the Dock or choose Enter Time
Machine from the Time Machine menu.
The frontmost window moves to the center of the screen, and the
screen’s background changes to the “infinity mirror” display, with
copies of the window receding into the background (Figure 45).
159
Figure 45: Go “back in time” to a previous version of your data.
‣ Just to the right of the main window, click the top arrow (which
means backward in time). Time Machine zooms back to the most
recent backup in which that window’s contents were different.
Keep clicking to continue zooming back through previous ver-
sions of that window; click the bottom arrow to move forward in
time.
‣ Use the controls along the right edge of the screen to jump to a
particular backup. As you hover your pointer over the small
horizontal lines, they zoom in to display the date and (for recent
backups) time of the corresponding backup. Click any of these
lines to jump right to that version of the window. As you zoom
backward or forward in time, the date and time of the backup
you’re currently viewing is shown to the right of the main win-
dow.
4. Once you’ve selected the item you want to restore, decide whether
you want to restore it to its original location or somewhere else:
160
Finder. (Time Machine may prompt you to enter an administra-
tor password.) You can use this procedure even if you want to
restore an older version of a file but keep the current version.
After you click Restore and the Finder reappears, you’ll see an
alert asking whether you want to replace the existing file, keep
both copies, or keep the original (thus canceling the restoration).
If you decide against restoring any files, instead click the Cancel
button or press Esc.
Tip: For more details, including how to restore an entire disk with
Time Machine and how to restore data from within apps such as
Contacts and Mail, see my book Take Control of Backing Up Your Mac.
In any case, I simply want to emphasize that if you use any such app,
you should be certain it’s configured to perform backups without any
manual effort.
161
Drive. As long as that’s the case—and you haven’t disabled automatic
backups—you should be in good shape.
But many backup apps, especially those that have been around for
many years, run only on a schedule that you determine. Some apps can
run as often as once per minute; others can run no more frequently
than once per day. Apps that require scheduling include ChronoSync,
Intego Personal Backup, and QRecall, among others.
Follow the instructions that came with your backup app to schedule
backups. You can choose what frequency works best for you, which
should take into account how actively you modify files and how much
of an impact the backup app has on your system when it runs. For me,
once an hour is too infrequent, but even if you use your Mac only
casually, I suggest scheduling backups to run at least once a day.
162
Automate Mac-to-Mac Syncing
Do you use two or more Macs regularly? If not, skip ahead to the next
chapter. But if you do, you may find it useful to keep some or all of the
data in sync between Macs. I can say from experience that it’s far
better to automate this process than to do it manually!
First, is it desirable (or even possible) to keep all your personal files in
sync between two Macs?
You’ll notice, by the way, that I said personal files. You should never,
ever try to sync all files between two Macs—in particular, stay far away
from the top-level /System, /Library, and /Application folders, as well
as any hidden folders. Attempting to sync any of those can lead to
serious data corruption, including an inability to boot your Mac. So
whatever you choose to sync, make sure it’s not part of macOS.
I’ll use Dropbox as an example. If it turned out that you had 800 GB of
data you wanted to keep in sync between two (or more) Macs, you
could purchase 2 TB of storage from Dropbox for about $120 a year.
Install Dropbox on your Macs, make sure all the files you want to sync
are in your Dropbox folder, wait for that initial upload to finish, and…
you’re done. You never have to run sync software or take any other
manual action; file changes propagate almost instantly. As a bonus, the
files in your Dropbox are also available on your mobile devices, and
can be shared easily with others.
163
What’s true of Dropbox is also true of numerous competing services—
Box, Google Drive, Microsoft OneDrive, SpiderOak One Backup,
SugarSync, and many more. They each have their own features, bene-
fits, and pricing, and you may prefer one over the others for any
number of reasons. But they all can perform the essential task of
syncing the contents of one or more folders across Macs automatically.
Then there’s iCloud Drive, which is built into macOS and iOS/iPadOS.
Superficially it works much like Dropbox, and it can keep whatever
files you store in it in sync between your Macs automatically. In fact,
iCloud Drive can optionally sync your Desktop and Documents folders
across your Macs too. That’s nice in theory, but I’ve found it to be
problematic in practice because of the extremely large and frequently
modified files I keep in those two folders. (You can disable this feature
in Ventura or later by going to System Settings > Account Name >
iCloud > iCloud Drive and turning off Desktop & Documents Folders;
in Monterey or earlier, go to System Preferences > Apple ID > iCloud,
click the Options button next to iCloud Drive, deselect the Desktop &
Documents Folders checkbox, and click Done. After doing this, select
iCloud Drive in the sidebar of any Finder window, open the Desktop
folder within it, and drag its contents to your desktop. Repeat with
your Documents folder.)
Tip: If you happen to choose iCloud Drive for cloud syncing, check
out Take Control of iCloud.
Of course, you may not want to sync files via the cloud, due to privacy
concerns, cost issues, available bandwidth, or the sheer volume of data.
If that’s the case, you might want to consider sync software such as:
164
• ChronoSync: This powerful and flexible app can sync files between
folders, volumes, or Macs in almost any way you can think of: one-
way, bidirectionally, with or without filters, and so on. (For Mac-to-
Mac syncing, you may want the add-on ChronoAgent app on one of
the Macs.) You can set up syncing to happen as frequently as once a
minute. ChronoSync can also create both versioned backups and
bootable duplicates, if you like, although it’s not quite as easy to use
as Time Machine or Backblaze.
165
Discover macOS
Automation Technologies
As we’ve seen so far in this book, macOS offers lots of ways to auto-
mate individual activities. But some automation tasks require apps to
talk to each other (or even to other computers), employ sophisticated
logic or user interaction, or perform specialized functions that are
unique to your situation. When simple tools aren’t up to the job, it’s
time to bring in the heavy hitters.
166
So I’ve chosen to arrange these topics in order of what I consider least
to most intimidating. Get to know the ones earlier in the list first, and
as your knowledge and skills grow (or your needs outgrow the less-
intimidating tools), move on to the next:
• Services are plugins that add features for working with text, graph-
ics, and more to almost any app. macOS comes with a number of
built-in services, and many popular apps add their own. You can
also install standalone third-party services, or create your own using
Automator or other tools. See Use Services for Systemwide Short-
cuts.
• Shortcuts is an app that started out in iOS and iPadOS, and ap-
peared on the Mac for the first time in Monterey. Like Automator
(described next), it offers a simple, user-friendly way to wrap up
sequences of tasks into a single automation. It’s the hot new thing,
and in some ways, it’s even more powerful than Automator, but it’s
not quite ready to replace it yet. See Get Started with Shortcuts.
167
can. But they do require you to interact with your Mac in a pure text
environment, which you may find confusing or off-putting if your
only experience using a computer has been through a graphical user
interface. See Script the Command Line with Shell Scripts.
Worried that this all sounds too complicated? Don’t be. I want to make
sure you understand this crucial concept up front:
1. Learn how to locate, install, and use scripts or tools written by other
people.
3. When you have time to tinker, start to create your own scripts/tools,
using the resources I recommend (and with other people’s work as a
guide).
But before I turn you loose on that stuff, I want to mention two other
important automation approaches that you should be aware of.
168
you can use it for Mail rules, Calendar alarms, and anywhere else you
can use AppleScript.)
For one thing, lots more people know JavaScript than know Apple-
Script. If you already know a bit about JavaScript programming—for
example, from designing websites—you can now use that skill to
automate activities on your Mac, without having to learn a new (and,
let’s face it, rather quirky) programming language. All you need to
learn is how to reference the objects and methods you want to interact
with (most of which are similar to, if not identical to, the correspond-
ing AppleScript terms).
Tip: To learn the terminology for interacting with Mac apps using
JavaScript, open Script Editor, choose File > Open Dictionary, select
an app, and click Choose. Then, from the Language pop-up menu at
the top of the dictionary window, choose JavaScript instead of Apple-
Script.
JavaScript also lets you write code that can be used in both macOS and
iOS versions of certain apps (see Use Omni Automation). That usage
could plausibly extend to other developers’ apps in the future.
169
Using Swift for Automation
Since the introduction of Mac OS X, Objective-C has been the primary
language programmers used to create full-blown apps for macOS (and,
later, iOS, watchOS, and tvOS). In 2014, however, Apple debuted a
brand-new programming language called Swift, which was designed to
be more modern, easier to use, and less prone to certain kinds of errors
and bugs than Objective-C. In the years since, Swift has undergone
rapid development. It hasn’t yet completely replaced Objective-C (and
indeed, for some programming tasks, Objective-C is still the superior
choice), but it’s well on its way. Nearly any type of app can be written
entirely in Swift, and it’s clearly the future of programming as far as
Apple is concerned. There’s even a free app called Swift Playgrounds
(available for Mac and iPad) that teaches you how to code in Swift
using a game-like interface.
170
Use Services for
Systemwide Shortcuts
In macOS, a service is a special, context-sensitive program that can
operate almost anywhere. You can find services on the Services sub-
menu of the application menu (that is, the menu with the current app’s
name). Alternatively, right-click (or Control-click) something and
choose a service from the very bottom of the contextual menu. (Ser-
vices appear on a Services submenu of the contextual menu if more
than four of them are active and applicable to whatever you selected.)
Note: Quick Actions are a subset of services that includes any service
you create as described in this chapter. Starting in Monterey, Quick
Actions no longer appear in the Services submenu of the Finder’s
right-click/Control-click contextual menus, but rather in the Quick
Actions submenu. In addition, they still appear in Application Name >
Services.
171
Before you do anything else, you should configure the services on your
Mac to your taste. Not all the services installed on your Mac are neces-
sarily active (only active services appear on the Services or Quick
Actions submenus); you can enable or disable services as you wish. In
addition, you can assign a keyboard shortcut to any service to avoid
hunting for it in a hard-to-reach submenu.
Configure Services
To set up Services on your Mac:
2. Select the checkbox next to any service you want to enable; deselect
those you want to disable. (Remember, selected services appear in
the Services or Quick Actions submenu only when the context—the
app and data type—are appropriate.)
172
3. To add a keyboard shortcut to a service that doesn’t have one in
Ventura or later, double-click the light gray word “none” to the right
of the service name; in Monterey or earlier, click “none” once and
click Add Shortcut. (To change an existing shortcut, double-click it.)
4. Press the new key combination you want to use for the service. (To
remove a shortcut, select it and press Delete.)
Beyond what comes with macOS and the apps you already have, there
are a great many free services you can download that are extremely
useful. For instance:
• The Download Services page at Mac OS X Automation has dozens of
services for images, email, movies, PDFs, web browsing, and other
contexts.
• DEVONtechnologies’ Download page has two services: CalcService
(for performing calculations on text selections) and my favorite,
WordService (which includes numerous commands for reformat-
ting and manipulating text).
• Markdown Service Tools from Brett Terpstra help you format text
using the popular Markdown syntax.
173
Once you’ve downloaded a service, move or copy it into /Library/
Services (to make it available to all users) or ~/Library/Services (to
make it available only to you). Then go back to System Settings >
Keyboard > Keyboard Shortcuts > Services or System Preferences >
Keyboard > Shortcuts > Services to enable the specific commands you
want to use and assign or change keyboard shortcuts.
But wait, there’s more! You can create your very own service, without
any programming at all, using Automator, which I discuss in the next
chapter. (For instructions, see the Create Your Own Service).
Tip: To learn more about services, visit the Services portion of the
Mac OS X Automation site. The page is quite old, but most of the
information is still applicable to recent versions of macOS.
174
Get Started with
Shortcuts
This entire book is about shortcuts in the generic sense: things that
save you time and effort. In this chapter, however, I want to introduce
you to the app called Shortcuts, and the automations you can create
with it—which are, of course, also called shortcuts!
175
those new to Shortcuts, you’re in for a treat: it provides a friendly,
approachable way to string together a wide variety of tasks that then
run on demand or when certain conditions are met.
Explore Shortcuts
Let’s take a moment to look around the Shortcuts app and explore
some of the prebuilt shortcuts you can use without any extra effort.
This point is pretty important: you can get a lot of value from Shortcuts
without ever creating any of your own custom shortcuts. You can also
customize these existing shortcuts to meet your needs.
176
When you open Shortcuts (found in /Applications), you should see
something like Figure 47. You will, of course, have different shortcuts
than I do, and what you see will depend on which category is selected
in the sidebar. Figure 47 shows All Shortcuts selected, which includes
any shortcuts you had on your iOS/iPadOS devices, as well as a Starter
Shortcuts category with some examples from Apple. (You can also see
those by selecting Starter Shortcuts in the sidebar.) We’ll get back to
the Starter Shortcuts in a moment.
Figure 47: The All Shortcuts view in the Shortcuts app as it hap-
pened to appear on one of my Macs.
177
Figure 48: Gallery shows shortcuts from Apple you can install.
Browse through the Gallery, using the “See All” links in each category,
to find more shortcuts, or use the Search field to look for something of
interest. When you find a shortcut you’d like to try, click its plus
icon to install it. It then appears in All Shortcuts.
Run a Shortcut
Once you’ve found and installed a shortcut you want to use (or created
one yourself, as I discuss shortly), there are many ways to run it. Here
are a few of them:
• Click play: Hover over the tile for any installed shortcut and click
its play icon.
• Use Siri: Activate Siri and say the shortcut name. For example, if
you have Listen for “Hey Siri” selected in System Preferences > Siri,
you could say “Hey Siri, Text Last Image” to run the Text Last
Image shortcut.
178
• Use the Dock: Click and hold, right-click, or Control-click the
Shortcuts Dock icon and choose Run Shortcut > Shortcut Name
from the contextual menu.
• Use the menu bar: Drag any installed shortcut to the Menu Bar
category in the sidebar. Once you’ve done that, you can choose the
shortcut’s name from the Shortcuts icon that appears on your
menu bar. If you hover over the shortcut name, you can click the
arrow icon on the right side to open the shortcut for editing.
• Use the command line: In the Terminal app, you can enter
shortcuts run name (where name is replaced with the shortcut’s
name) to run that shortcut; you can also enter shortcuts list to see
what shortcuts are available. Jason Snell offers even more details
and tricks in his article Run shortcuts from the Mac command line.
179
much any existing Automator workflow you might have, converting it
to a shortcut with the same functionality. In my experiments so far,
almost every attempt to import Automator workflows failed in one way
or another. Often, an error message would appear, informing me that
some action within the workflow was incompatible with Shortcuts
(Figure 49). On other occasions, Shortcuts imported the workflow
successfully, but then failed to run it without throwing an error.
So, with the gigantic qualification that the process is as likely as not to
fail, here’s how to import a workflow:
180
2. Navigate to the Automator workflow you want to import and select it.
3. Click Open.
That’s it! If you’re lucky, Shortcuts creates a new shortcut that works
just like the old workflow.
Customize a Shortcut
A great way to understand how shortcuts work is to open a bunch of
the sample shortcuts Apple supplies and examine how the actions are
arranged and configured. Then, try a few small changes here and there
to see what happens. By making simple changes (such as changing the
contents of a text field or which app is used to open a given file type),
you can then customize shortcuts to better meet your needs. Having
done that, you can experiment with adding, removing, or swapping out
actions until you become comfortable enough to create your own
shortcuts from scratch.
Available actions appear in the sidebar on the right. You can sort them
by category or app, or use the Search field to look for an action that fits
the bill. To add an action to your shortcut, either double-click it or drag
it into the editing view. You can then rearrange actions using drag and
drop, fill in additional parameters (which sometimes requires clicking
Show More), or delete an action by hovering over it and clicking its
close icon.
181
Figure 50: The Shortcuts editor, showing one of Apple’s starter
shortcuts.
182
Figure 51: Actions that might have privacy implications ask you to
grant them access.
Create a Shortcut
Just to give you a quick Shortcuts example to get your feet wet, let’s
create a new shortcut from scratch that sends a message to the recipi-
ent of your choice with the title and artist of whatever song you’re
currently listening to in Music. That in itself may not be particularly
useful, but it provides a good way to illustrate some of the basic behav-
iors of Shortcuts.
1. Open Shortcuts if it’s not already running and click the Add Short-
cut icon on the toolbar.
2. Click in the Shortcut Name field at the very top of the new window
that opens and type a name for your shortcut, such as Send Message
with Current Song and Artist.
183
The Get Current Song action hands Shortcuts all the information
about the current song, including the album name, song duration,
and tons of other metadata. We want two specific pieces of informa-
tion—the song title and the artist name—so we’ll add actions to get
those items and put them into variables to use later.
4. Find the Set Variable action. Find it in the Scripting category with
Categories selected, or search for set variable. Double-click it to
add it to your shortcut. So far, your shortcut looks like Figure 52.
5. Click in the Variable Name field and type a name for the variable—
we’ll use SongTitle.
6. The variable is currently getting its input from the item above it, as
indicated by the vertical line that connects the two. But the value of
the variable is set by default to Current Song, which is not what we
want. We want something more specific—the song title. To get that,
click Current Song, and, in the popover that appears, scroll down in
the Get list at the bottom to Title and select it. The variable value
changes to Title (Figure 53).
184
Figure 53: Select the value of the SongTitle variable here.
9. Next, click the Input label that now appears next to ArtistName and
choose Select Variable (Ventura or later) or Select Magic Variable
(Monterey) from the contextual menu.
Note: In the next few steps, you might think, “Wait, this is weird.
Why am I doing this?” And if you use Monterey, you may be thinking,
“Magic Variable…huh?” I sympathize. Shortcuts is kind of weird in
spots. To learn all about magic variables and break through much
(though not all) of the weirdness, read Take Control of Shortcuts.
185
10. Select the Current Song item that appears underneath the Get
Current Song action and (in Monterey only) click Done.
11. Click Current Song in the ArtistName variable and select Artist
from the Get list at the bottom. Your shortcut should now look like
Figure 54.
Figure 54: The shortcut as it appears after adding the first three
actions.
12. Now that we have two variables with the information we’re looking
for, we can use them to send a message. Add a Send Message
action to your shortcut, which you can find in the Sharing catego-
ry, under the Messages app, or using search.
13. We want to edit the contents of the message, which are set to
ArtistName by default. Doing this is a bit tricky: double-click just
to the right of the ArtistName variable in the Send Message action.
(It may take a few tries to find the exact spot.) The variable name
darkens and an insertion point appears. Press ← to move the
insertion point to the left of the variable and type I’m currently
listening to (followed by a space). Then type SongTitle, which
pops up the variable by the same name; click that. Type a space,
the word by, and another space. Press → and type a period.
186
Figure 55: The finished (for now) example shortcut.
To test your shortcut, open the Music app and play something. Then
return to Shortcuts and click the play icon on the toolbar. You
should see something like Figure 56; at this point you can go ahead
and click Send to send the message or click Cancel.
But wait a minute. What if Music isn’t open or no song is selected? The
shortcut would work, but because the variables are empty, it would just
say “I’m currently listening to by.” We could avoid this by adding an If
statement to first check and see if the current song has any value. If it
doesn’t, we could display an error message and stop; if it does, we can
run the rest of the shortcut.
187
To add the new logic, follow these steps:
1. Add the If action (found in the Scripting category) and drag it to just
below the Get Current Song action.
2. In the If action, click Condition (to the right of Current Song, which
should be filled in automatically) and choose “does not have any
value” from the pop-up menu.
To this point, we’ve created an If statement that says: “If the current
song has no value, do something; otherwise, do something else.” So
now let’s fill in the “something” and “something else.”
3. Find the Show Alert action and drag it into your shortcut right after
the first portion of the If action. (You might have to drag it well
below where you want it to go for the above and below actions to
slide out of the way to accommodate it.)
4. Select “Do you want to continue?” and replace it with your own text,
such as Music isn’t playing anything right now.
188
Figure 57: An If statement can add branching logic to your shortcut.
If you now quit Music and run the shortcut, you should get the alert
from step 4. Open Music and click Play, then run the shortcut again,
and it should work as before.
Could you do more with this shortcut, such as open Music if it’s not
already open, send a message without a prompt, or play a particular
track or playlist? Absolutely—all that and more. I leave those details as
homework for you.
Share a Shortcut
Your shortcuts automatically sync across your own devices—that is,
those signed in with the same Apple ID.
189
However, if you want to share a shortcut with someone else, you can
use the Share menu, just as in any other app. Depending on the
actions in the shortcut you share, the recipient may be prompted to
approve sending data to other locations—anything that might poten-
tially affect their privacy should require explicit permission.
190
Get Started with
Automator
Automator is an easy-to-use technology, included as part of macOS, for
bundling actions into sequences known as workflows. If programming
gives you the willies, Automator is nothing to fear. You don’t have to
learn a new language or write in code—just drag things into a list, fill in
some blanks, and check some boxes.
• Convert a movie file to a size and format suitable for your iPhone or
iPad
191
In much the same way as in Shortcuts, workflows are made from
building blocks called actions. Automator includes many actions, as do
a number of the applications bundled with macOS (such as Calendar,
Contacts, Mail, Music, and Preview). Just as a third-party app may or
may not include AppleScript support, some apps come with their own
Automator actions and some don’t. A few third-party apps with good
Automator support are BBEdit, LaunchBar, Microsoft Office, Pixelma-
tor, and Transmit. (In some cases, notably BBEdit, Automator support
for an app requires a separate download and installation.) In addition,
actions can optionally contain instructions written in numerous
programming and scripting languages, including AppleScript; Java-
Script; Perl, Python, and Ruby (if installed); and shell scripts.
I’ll show you how to make a few simple Automator workflows. Then I’ll
tell you about some of your other options, where to find existing
workflows that you can use as is or modify to meet your needs, and
how to learn more about Automator.
192
Figure 58: An empty Automator workflow window.
4. If you don’t see a Library list in a sidebar on the left, click Show
Library on the toolbar.
The Library is the list of available actions. You can click a category
or app name to see its available actions, or type a search term into
the Search field to find matching actions.
5. Type text into the Search field to show only text-related actions in
the second column.
6. Locate the Ask for Text action in the second column, and drag it
into the workflow area on the right (Figure 59).
As the name suggests, this action displays a dialog that asks you to
enter text.
193
Figure 59: The Ask for Text action, ready to be filled in.
7. Fill in the question you want the dialog to ask, such as What would
you like me to say? and, if you like, fill in a default answer, such as
Beep. Select the Require an Answer checkbox to ensure that some
text must be entered (so that the workflow always does something).
8. Return to the second column, find the Speak Text action, and drag it
below the Ask for Text action (Figure 60).
You’ll notice that the two actions join together to show that the
output of the first one (whatever you type into the dialog) is fed as
input into the second one.
9. If you like, choose a different voice from the Voice pop-up menu.
194
Your workflow is now ready. To run it, click the Run button on the
toolbar. You should see a dialog asking you what you want it to say.
Accept the default answer or supply a new one, click OK, and your Mac
speaks that text.
To reuse a workflow, save it (choose File > Save, choose a name and
location, and click Save); you can then double-click it to reopen it in
Automator. Or you can save it as an app (same procedure, but choose
Application from the File Format menu in the Save dialog), and you get
a standalone, double-clickable Automator app. (For other ways to
package a workflow, see the sidebar Automator Workflow Types.)
195
3. From the Photos category, drag the Scale Images action to your
workflow.
An alert appears, telling you that the action you just added will
change files passed into it. If you wanted Automator to add a step
here so that it works on a copy of the file instead, you could click
Add. But for the purpose of this example, we don’t—we’re going to
go ahead and change the original—so click Don’t Add. (You’ll see
this alert a few more times before we’re done with this workflow!)
5. From the Photos category, drag the Change Type of Images action
to your workflow. Once again, click Don’t Add in the alert that
appears. Choose JPEG from the To Type pop-up menu.
6. From the Files & Folders category, drag the Rename Finder Items
action to your workflow. Click Don’t Add, as usual. From the first
pop-up menu, choose Change Case. Leave the second set to “Base-
name only,” and choose Title Case from the third.
7. From the Files & Folders category, drag another instance of Re-
name Finder Items to your workflow, and yet again, click Don’t
Add. This time, choose Add Text from the first pop-up menu. Then
fill in “ Scaled” (that is, a space followed by the word Scaled) in the
text field, and leave the other pop-up menu set to “after name.”
8. Choose File > Save, enter a name (such as Scale & Rename), and
save the app. The final version should look something like Figure
61.
196
Figure 61: The final version of the Scale & Rename app.
To run the app, first make a copy of a graphic that you don’t mind
altering, or take a quick screenshot just so you have a disposable
graphic file to work with. Drag that graphic onto the app you saved in
step 8. You should see the title change (for example, “my graphic.png”
would become “My Graphic Scaled.jpg”) and if you open the graphic in
Preview, you’ll see that it’s in JPEG format and at 50% of its original
size. (Needless to say, you can adjust the size, format, and naming to
something that would be more useful to you.)
• You can reorder the steps any which way. In some cases, order is
significant (you need to make one change before making another
one that depends on it), but in this case, it doesn’t matter. You
could, for example, drag the two renaming steps above the two
image steps and get exactly the same result.
197
• Although I asked you to opt out of the steps that make copies of the
file (just to keep the example short and sweet), you should pay
attention to that option in real life—especially when a file format
changes or unrecoverable data might be lost.
• Sometimes you need multiple instances of the same action (as with
“Rename Finder Items” here) to get the desired end result.
Tip: Forgotten what services are? Refer back to Use Services for
Systemwide Shortcuts.
• in: Use this pop-up menu to choose whether your service should be
available in any application, or only in a specific application.
(Choose Other and navigate to the app if it doesn’t appear in the
menu.)
• Input is: For certain data types only, you can use this pop-up
menu to determine whether the service acts on the Entire Selection
198
or only the relevant portion of it—for example, Only Addresses,
Only URLs, or Only Dates.
• Output replaces selected text: For text and rich text selections
only, check this box if you want the service to replace whatever’s
selected after the service runs. For example, if you select a word and
run a service that translates it into another language, you may want
the translated word to replace the original.
Then build your workflow as usual, save it, and give it a name. Aut-
omator automatically stores it in ~/Library/Services.
Here’s a simple example that scans selected text, extracts all email
addresses that end in icloud.com, puts those in a new text file, one
address per line, and displays that document.
3. From the Text category, drag the action Extract Data from Text to
the workflow. From the Extract pop-up menu, choose “email ad-
dresses.” (You could instead just as easily choose a different catego-
ry to extract URLs, dates, addresses, or phone numbers.)
4. From the Text category, drag the Filter Paragraphs action to the
workflow. From the “Return paragraphs that” pop-up menu, choose
“contain,” and in the field that follows it, type icloud.com.
5. Returning to the Text category once more, drag the New TextEdit
Document action to the workflow.
199
Your workflow should now look something like Figure 62.
6. Now choose File > Save and give your workflow a name (such as
Extract iCloud Addresses).
To use the workflow, find or create text containing at least one email
address ending in icloud.com. (For testing, you could grab some dummy
text from www.lipsum.com, paste it into any word processor, and type
in a few icloud.com addresses here and there.) Select the text and then
choose Application Name > Services > Service Name, where “Applica-
tion Name” is the name of the app you’re using and “Service Name” is
the name you chose in step 5. Automator scans the text, extracts the
email addresses, filters them so that only the icloud.com addresses
appear, adds those (one per line) to a text file, and opens it in TextEdit.
200
Tip: If you ever encounter a situation in which you explicitly want to
avoid having an action take input from the previous step in an Aut-
omator workflow, right-click (or Control-click) it and choose Ignore
Input from the contextual menu. (That command is disabled in
contexts where it would lead to an unusable workflow.)
201
Enabling Third-Party Actions in Automator
The first time you attempt to run a workflow that contains an action
provided by a third-party (non–Apple) app, at least in Ventura or
later, Apple prompts you to enable such actions (Figure 63).
Figure 63: This alert tells you to explicitly enable third-party actions.
Click Open Automator. Then choose Automator > Third Party Aut-
omator Actions. In the dialog that appears (Figure 64), select
“Enable Automator actions from third parties” and click OK.
202
Find and Run Sample Workflows
Automator workflows you find online usually work unmodified on your
Mac—you double-click them and, depending on how they were saved,
you either run them in Automator or they run as apps. (If you want to
edit an Automator app, drop it onto the Automator icon.)
Try some of the sample workflows (most of which should still work
fine, even if they’re a bit old) at these sites:
You may find workflows that almost do what you want them to do.
Feel free to experiment by changing options within actions, or swap-
ping out one action for another. Unlike AppleScript, Automator makes
it simple to tinker without worrying that you’ll make a syntax error or
have no idea what command to use—your only building blocks are the
actions you see in the list.
203
Get Started with
AppleScript
Whereas Automator lets you construct a workflow visually by dragging
and dropping actions into a list, AppleScript is a scripting language—a
type of simplified programming language that runs only in a specific
environment (in this case, macOS). That means AppleScripts can run
only on a Mac, and because your Mac must interpret the commands in
the script as it runs, an AppleScript won’t have the high performance
of a conventional Mac app. Even so, AppleScripts can look and act like
ordinary Mac apps. You may already be using some apps that were
written in AppleScript without even realizing it!
AppleScript has been around since way back in 1993, and it’s become
popular among people who like to tinker but wouldn’t consider
themselves programmers, because it’s built into macOS and is a lot
easier to work with than a big, complicated language like Swift or
Objective-C. AppleScript is often referred to as “English-like,” which is
a generous description at best, but if you don’t know much about
programming, you can probably make more sense of AppleScript code
than, say, Java.
204
3. Type the word beep (Figure 65). Your script is now complete!
Tip: You can manually compile a script (without running it) to check
its syntax, reformat it, and add automatic indentation by choosing
Script > Compile (⌘-K) or clicking the Compile button on the
toolbar.
Now that you’ve written and run an AppleScript, you can follow the
same steps to run scripts other people have written—simply type (or
copy and paste) the scripts into AppleScript Editor and click the Run
205
button. We’ll come back to this idea in a bit, but for now, I merely
want to point out that using AppleScript can be as simple as that.
Fine, you may say, but what exactly can AppleScript do?
Well, if you want to know every built-in command and option, with
detailed background and examples, check out Apple’s massive
Introduction to AppleScript Language Guide. It’s written mainly for
developers, but it’s reasonably clear, and well worth consulting.
206
But that tells you only about AppleScript. To find out what you can do
with AppleScript in a particular app, you’ll need to look elsewhere.
Unfortunately, not all apps support AppleScript, and of those that do,
some of them have rather meager dictionaries (meaning you can’t do
very much with them). But there are enough deeply scriptable apps out
there to enable you to accomplish a great deal with AppleScript.
207
• Apply proper title case to the names of all your tracks in Music
Tell Blocks
As you’ll notice in the examples ahead, most scripts start with tell
application "App Name" on a line by itself, and conclude with an end
tell line, with everything else indented in between. These are
examples of tell blocks, a ubiquitous construction in AppleScript. With
a handful of exceptions (that is, commands interpreted by AppleScript
itself rather than sent to an app), nearly everything you do in
AppleScript involves telling some object (an app, a window, a
paragraph) to do something. So you must always pay attention to
which object you’re directing the current command, or set of
commands to.
208
Tell blocks can be nested explicitly, in order to refer to an object that’s
contained inside another object:
Either way, if something isn’t working the way you expect, the first
thing you should ask yourself is whether you’re telling the right entity
to do something.
209
So this, for example, would be treated as one long line:
Variables
Like all programming and scripting languages, AppleScript supports
variables of several kinds. In most cases, you don’t need to go through
an extra step of declaring a variable to tell AppleScript what type of
data it will store, because as long as you assign a value to a variable the
first time you use it, AppleScript figures out what its type is automati-
cally. To set a variable, you use the set command, like so:
That makes a variable of type string, since what you set it to was a
string. You can also make an integer (set someNum to 12 + 34), a
boolean (set isIt to true), a list (set theItems to {"cube", "sphere",
"wedge"}), and numerous other classes.
How do you later retrieve the value of a variable? Simple: you use the
get command, as in:
get someWord
Display Dialog
Sometimes you’ll want to inform yourself, or whoever’s running your
script, about its results, ask a question, or simply display the current
210
value of a variable for the purpose of debugging or troubleshooting.
For all these purposes and more, you’ll want to become good friends
with the display dialog command, which produces a simple dialog
with customizable buttons (Cancel and OK by default), the text of your
choice, and an optional text entry field.
Here are some common variants—try mixing and matching these to get
different results:
• Dialog with a field, whose value goes into a variable (Figure 69):
set firstName to text returned of ¬
(display dialog "What is your name?" default answer "")
211
Figure 69: Dialogs can ask for text responses.
If/Then Statements
You can use an if/then statement (or if/then/else) to execute one or
more commands only if a certain condition is true. Although there are
multiple ways to format these, the most common ones look like these:
set myNum to 3
if myNum is less than 4 then
display dialog "Yes, " & myNum & " is less than 4."
end if
(Note that you must include the word then at the end of the if line; if
you don’t, AppleScript will add it for you.)
212
set firstName to text returned of (display dialog ¬
"What is your name?" default answer "")
if firstName is "Joe" then
display dialog firstName & " is awesome!"
else
display dialog firstName & " is OK."
end if
Comments
To put a note to yourself or other people within a script that won’t be
executed, put two hyphens (--) in front of it, like so:
If your comment runs longer than a line, you can instead surround it
with (* and *), like this:
213
Tell me how many files and folders are on my desktop:
tell application "Finder"
set theFolder to (path to desktop) as string
set theCount to number of items in folder theFolder
display dialog theCount
end tell
214
Do a bit of simple math:
set firstNum to text returned of (display dialog ¬
"Enter a number." default answer "")
set secondNum to text returned of (display dialog ¬
"Enter a number." default answer "")
set operation to button returned of (display dialog ¬
"What do you want to do with those two numbers?" ¬
buttons {"Add", "Subtract", "Multiply"})
-- AppleScript dialogs can have a maximum of 3 buttons
if operation is "Add" then
set theResult to firstNum + secondNum
else if operation is "Subtract" then
set theResult to firstNum - secondNum
else
set theResult to firstNum * secondNum
end if
display dialog "The result is: " & theResult
You can also find a bunch of sample scripts already on your Mac, in
the /Library/Scripts folder. You’ll notice that those scripts—and
perhaps many of those you find online—aren’t just text; they’re
AppleScript files. One way to use any of these is to double-click the file
(which opens it in Script Editor) and then click the Run button. (For
scripts located in /Library/Scripts, you’ll be prompted to click a
Duplicate button before your script runs so that changes can be saved.)
But that’s not the only way!
215
can add to the menu by placing your scripts in one of those folders (or
a subfolder).
Figure 71: The optional AppleScript menu displays both built-in and
user-supplied scripts, letting you run them with one click (and
without opening Script Editor).
To save any of your own scripts (including those you created using the
sample code just previously) as files, choose File > Save, choose a name
and location, and leave the File Format pop-up menu set to its default
choice of Script. Then click Save.
216
Tip: Besides running an AppleScript in Script Editor, from the
AppleScript menu, or as standalone apps, you can also trigger
AppleScripts using many of the other utilities discussed in this book,
such as Keyboard Maestro, LaunchBar, and TextExpander.
You might start, for example, with the Resize the frontmost Safari
window script from a few pages back. Try replacing Safari with the
name of another app. Or, try changing this line:
Then try playing with the front window term. What if Safari has two
windows open? Can you guess how to resize the back window? (It’s
exactly what you think.) Then try changing the text of the dialog that
appears if Safari has no windows open. And so on.
217
Script Debugger: A Better AppleScript Editor
So far, I’ve been talking about Script Editor as though it’s the only
environment in which you can create and run AppleScripts, but it’s
not. There are numerous other tools (including Automator, Keyboard
Maestro, Shortcuts, and other utilities) that let you enter, edit, and
execute AppleScript code. And for basic scripts, any of them will do
nicely.
But when you get to the point of needing to create long, complex, or
tricky scripts, you should use an editor with more power and flexibili-
ty. There’s really no competition here—the script editor AppleScript
pros use is called Script Debugger.
Script Debugger is to Script Editor as Nisus Writer Pro is to TextEdit.
Sure, both tools will format your scripts, show you results, and let
you save them in various formats. But Script Debugger goes way
beyond that. For example, it offers the following features:
✦ Debugging: As the name suggests, Script Debugger’s forte is
helping you find and fix bugs in your scripts—for example, by
stepping through a script one line at a time and seeing the values
of variables and the results of actions at every step.
✦ Explorer: Go way beyond an app’s AppleScript dictionary to see
the exact objects and properties that currently exist in the app and
its open documents. This makes it way simpler to write scripts
that access those objects and properties.
✦ Clippings: Insert frequently used code blocks with a click or two.
✦ Code Folding: Temporarily collapse individual blocks of code to
make it easier for you to see the overall flow of your script.
✦ AppleScriptObjC Code Completion and Debugging: If you use
AppleScriptObjC to write Cocoa apps using AppleScript (see Writ-
ing Cocoa Apps with AppleScript), these features will make the
process much simpler.
That’s just the beginning—Script Debugger offers a long list of addi-
tional powerful features. It’s overkill for beginners, but anyone who
writes more than a modest amount of AppleScript code will find the
savings of time and effort to be well worth the cost of the app. (And
you can save 15% with the coupon at the end of this book!)
218
Tip: If an AppleScript that used to work in an older version of macOS
no longer does, you might just have to open it and re-save it in Script
Editor to re-authorize it. Glenn Fleishman explains in How to use
Script Editor to re-authorize a balky AppleScript in macOS Catalina
and later.
In GUI scripting, your script sends commands via a hidden app called
System Events. System Events, in turn, tells a particular app (or other
process) to click buttons, press keystrokes, and so on. (You’ll need to
enable each app individually in System Preferences > Security &
Privacy > Accessibility before they’ll respond to GUI scripting; this
applies both to the target app and to apps that run scripts, such as
Script Editor and Script Debugger. See Deal with the Mac’s Evolving
Security Features for more details.)
219
tell application "System Events"
tell process "Readiris"
click button "OK" of sheet 1 of front window
click menu "File" of menu bar 1
click menu item "Export Document..." of menu ¬
"File" of menu bar 1
end tell
end tell
As you can see, as long as you can tell System Events precisely where to
find a certain button or menu item, you can produce a click. (You can
also send a keystroke with a command like keystroke "n" or keystroke
return.) The problem, however, is that it’s often extremely difficult to
ascertain the hierarchy of objects leading to the one you want—and
worse, sometimes objects don’t respond to names at all.
Wow. So…how did I figure that out? Since nothing in the visible user
interface tells me the names or numbers of all those groups of ele-
ments, how did I arrive at that hierarchy? Well, I used magic, which in
this example was packaged into an app called UI Browser.
220
Figure 72: Browse an app’s hierarchy of UI objects in UI Browser.
In the previous version of this book, I reported that the app was being
discontinued because its developer, Bill Cheeseman, was retiring, the
app. However, Bill was able to hand the project over to Script Debug-
ger developer Late Night Software, so it’s still available for download.
In addition, the partially completed version 4 of the app (a rewrite
using Swift) has been made open-source. Although version 4 is missing
a lot of features, perhaps some enterprising developers will take it
upon themselves to finish it.
With or without the use of UI Browser, I should warn you that some
apps defy even GUI scripting, usually because they’re little more than
wrappers around custom web browsers. For example, GUI scripting
won’t get you anywhere with the team communication app Slack. What
appear to be links and icons in the app are just part of a monolithic
window as far as System Events is concerned. (In such cases, you may
be still able to take a brute-force approach to automation, by simulat-
ing clicks at certain coordinates, but for such tasks I’d use something
221
like Keyboard Maestro before trying to do something similar with
AppleScript.)
To learn much more about GUI scripting, read the page Graphic User
Interface (GUI) Scripting at Mac OS X Automation.
Not just any old AppleScript can be a folder action; it must be written
specially for that purpose. (For details, see the Folder Actions Refer-
ence page on Apple’s Developer site.)
In addition, before you can use folder action scripts, you must enable
the systemwide Folder Actions capability (if you haven’t previously
done so) and attach a particular script to the folder where your incom-
ing scans are stored. Here’s how:
1. Make sure whatever script you want to use is stored in the /Library/
Scripts/Folder Action Scripts folder or in ~/Library/Scripts/
Folder Action Scripts.
Note: You may see one or more security alerts when Folder Actions
Setup opens for the first time (see Deal with the Mac’s Evolving
Security Features). Just agree to them and move on.
3. In the dialog that appears, select the script you want to use.
(Although you can attach multiple AppleScripts to a single folder, I
222
don’t recommend it. Pick a single script, and if need be, you can
return to this dialog and change it later.)
4. Make sure Enable Folder Actions is checked at the top of the Folder
Actions Setup window. Your window should look something like
Figure 73.
Figure 73: You’re looking for approximately this end result (folder
and script names may differ) after configuring Folder Actions.
Now, to use your folder action, drop a new file in the folder (or take
whatever other action(s) the script supports, such as changing or
removing files). The script should run automatically.
Here are a few further examples of things you could do with an Apple-
Script folder action:
• Get an alert when someone puts a new file in a shared folder.
223
• Rename all the files dropped into the folder to follow a particular
format or convention.
224
Tip: Although AppleScript (as discussed in this chapter), JavaScript
(discussed ahead in Use Omni Automation), and Swift (discussed
back in Using Swift for Automation) are Apple’s official languages for
automating your Mac, you can choose other languages! For example,
an easy-to-learn language called Lua can also automate your Mac if
you install a free tool called Hammerspoon.
225
Script the Command Line
with Shell Scripts
As you probably know, macOS is based on Unix, and as such, there’s a
whole layer of functionality most users never see. But you can access a
long list of hidden files and useful tools in the text-based world of the
command line.
You normally access the command line on a Mac using the Terminal
utility (found in /Applications/Utilities). When you open Terminal, it
runs a special program called a shell, which interprets the commands
you type and delivers the text-based output. macOS comes with several
different shells, but that detail is unimportant for our purposes.
226
friends. They can modify files and folders, perform system functions,
and do other sorts of tricks that are difficult or impossible to perform
in other ways (such as using AppleScript or Automator). In fact, some
of my favorite AppleScripts, Automator actions, and Keyboard Maestro
macros rely heavily on embedded shell scripts.
Ordinarily, you create and run shell scripts in the Terminal utility (as I
show you next). However, as I mentioned, many of the other utilities I
cover in this book can run shell scripts too.
Tip: If you’d like to know all about the command line—how to get
around, run programs, edit files, and (of course) work with shell
scripts, pick up my book Take Control of the Mac Command Line with
Terminal.
You can create and run a shell script in six easy steps.
227
Step 1: Open Terminal
Open the Terminal utility (in /Applications/Utilities). You’ll be
presented with a mostly blank window. That’s where all the magic
happens.
#!/bin/zsh
echo "Hello! The current date and time is:"
date
echo "And the current directory is:"
pwd
The first line tells the script which shell program to use (in this case,
bash). The two echo commands simply put text on the screen. The date
command displays the date (surprise!), and the pwd (print working
directory) command displays your current directory. So, this script
228
displays four lines of text, two of which are static (the echo lines) and
two of which are variable.
cd /Library/Preferences
Now run the script again by typing ~/test.sh and pressing Return.
You’ll see that it shows your new location.
Tip: Any time you need to put a new script on your system, follow
these same steps (although the script name and location may vary).
229
Try Another Script
Here’s another script you may find handy. It generates a random
integer within a range you specify.
Tip: To learn more about shell scripting, read Apple’s Shell Scripting
Primer.
230
macro utility (like Keyboard Maestro), so that you can execute it with
just a keystroke or click—just as you can with AppleScript and Java-
Script. In fact, although Terminal is useful for experimenting with
scripts in real time, most apps that can run shell scripts let you type or
paste them in the app directly.
231
Run Actions Automatically
Recently I was setting up some background apps on one of my Macs to
run every time I restart the computer and to relaunch automatically if
they crashed. I was struck with the realization that, in earlier editions
of this book, I had never explained how to do things like that—for all
the examples of automation I gave, nearly all of them assumed that
automated tasks would be triggered manually.
Let’s correct that! In this chapter I tell you about various ways you can
get things to happen all by themselves on your Mac: after the initial
setup there are zero clicks, keystrokes, or button presses required.
While all those mechanisms are useful, what I cover in this chapter are
tools built into macOS that enable you—potentially without installing
any extra software—to trigger arbitrary actions of nearly any kind just
when they need to happen; and, more specifically, trigger them in
situations that may be inaccessible to those other methods.
For example:
• Open your favorite browser when you log in, but not when another
family member does.
232
• Copy files for a project you’re working on to a network server
whenever you mount that volume in the Finder.
• Open the Pages document containing materials for the class you’re
teaching whenever your office hours begin.
In some cases, there are multiple ways to trigger actions like these, and
you should pick whichever one you like best. Before choosing a
method, I suggest acquainting yourself with all the options.
233
Figure 74: The Login Items list in System Settings shows all the
items that open on every login for the current user.
To add something to this list, you can either drag it in from the Finder
or click the plus button, navigate to the item, and click Open. Al-
though applications are the most common item to open at login, you
can also add a file, folder, or volume—anything you can select in the
Finder. To remove an item from the list, select it and click the minus
button.
Login items apply to the currently logged in user only. So, if your Mac
has multiple users, each with a separate account, each person’s list of
login items will likely be completely different.
Be aware that your Mac might also open other items on login that
aren’t on this list! For example, when you restart or shut down your
Mac (using Apple > Restart or Apple > Shut Down), if “Reopen
windows when logging back in” is checked (Figure 75), whatever apps
and windows were open when you restarted or shut down will reopen
when you log back in, putting you approximately where you left off.
234
Figure 75: If “Reopen windows when logging back in” is checked,
your Mac will reopen any currently open apps and their windows
when you log back in.
235
purposes of this book, I’m going to ignore the email option (though you
should absolutely experiment with it if it’s of interest to you) and focus
on opening files.
I think Apple’s intention behind this feature was to let Calendar open
documents related to an event—for example, opening an agenda when
a meeting begins or a tax return when you have a scheduled call with
your accountant. You can certainly use it that way, but you can also
have this mechanism open something at a particular time without
there being any actual meeting or event connected to it. Opening the
item itself can be the event.
2. Fill in a name, date, and time for the event as usual in the popover
that appears (Figure 76).
236
3. From the “alert” pop-up menu, choose Custom. A tiny extra window
appears above the popover (Figure 77).
Figure 77: This extra window appears when you choose Custom.
5. Now, from the new pop-up menu labeled Calendar, choose Other.
Navigate to the item you want to open and click Select. Although
Calendar uses the word “file,” it can also be an app (or even an
AppleScript or Automator action saved as an application)! Whatev-
er you select will open when the time of the event arrives, exactly as
if you had double-clicked it in the Finder.
6. Optionally, click the pop-up menu labeled “At time of event” and
choose an earlier or later time.
7. Click OK.
That’s it! When the time comes, the item opens; for recurring events, it
opens each time. You can also, if you like, add multiple alerts to the
item—in addition to opening an item it could also show a message and
play a sound, for example.
237
Tip: To learn much more about the ins and outs of Calendar, read
Take Control of Calendar and Reminders by Scholle McFarland and
Glenn Fleishman.
Use Launchd
If you want vastly more control over when and how something runs,
there’s yet another option. macOS has a built-in, systemwide mecha-
nism called launchd (short for “launch daemon,” where daemon, in
computer-speak, is a program that runs in the background). In con-
trast to simpler auto-launch tools like cron, available in every flavor of
Unix and Linux, launchd is enormously flexible and powerful. It has the
capability to run apps, shortcuts, and scripts of all kinds automatically
in a variety of circumstances.
238
And to unleash all this power, the only configuration tool you need is…
a text editor. Any text editor. TextEdit will do just fine, as will BBEdit
or nano on the command line—anything that can edit and save plain
text files.
First, these files, which have to be given names following a strict and
unusual pattern, must also be saved in very specific places (discussed
just ahead), and they behave differently depending on which folder you
put them in.
Second, these text files have to be crafted just so, and even the tiniest,
most seemingly inconsequential error can cause launchd to give up
without so much as an error message, causing untold confusion. (I
speak from experience here.)
So, while I’ll give you a quick introduction to creating and using some
simple launchd items manually—just to show you that it can be done—I
recommend strongly that you pay a few bucks for an app that will
make the process vastly simpler and less error-prone if you want to do
anything beyond the very basics; I discuss these a bit later.
239
I should clarify the word “load” here. A launchd item might be config-
ured to run an app on a schedule or in response to some other event.
But macOS has to have previously loaded it—read its file and sched-
uled what’s supposed to happen. Loading normally happens either at
startup or at login. The fact that a launchd item loads does not neces-
sarily mean that the action it contains runs immediately, though that’s
one possible configuration.
Here are the locations of the special folders macOS monitors for the
presence of launchd items, and how they behave:
Since the first two folders can be modified only by Apple—due to the
system being an immutable, locked volume for several releases—you
need concern yourself only with the last three. In many situations,
which user owns a process is irrelevant. And if you’re the only person
using your Mac, the behavior of the three will be nearly indistinguish-
able. But, to clarify a bit further:
• If you want something to load only when you log in, and not when
any other user of your Mac logs in, you want a launch agent that
you’ll store in ~/Library/LaunchAgents.
240
Note: This may sound like Login Item, discussed earlier in this
chapter. Although both mechanisms can open an item on login,
launch agents are far more flexible. They can include not just files,
folders, volumes, and apps, but also command-line programs and
scripts; plus, they have far more options (such as restarting automat-
ically if they crash).
• If you want something to load when any user logs in, and have it run
under that user’s ownership, that’s also a launch agent; it goes
in /Library/LaunchAgents.
Note: Many, many apps also include their own launchd items bundled
within the apps themselves. Although these items can have the same
capabilities as regular launch agents and launch daemons, you won’t
interact with them or modify them yourself. So, I’m ignoring those in
this chapter.
241
write commands to modify some hidden preference; what that actually
does is change the contents of a .plist file.
Tip: To learn much more about using defaults write and making other
low-level modifications to your Mac, be sure to check out my book
Take Control of the Mac Command Line with Terminal.
Property list files, in turn, are written using a markup language called
XML (for eXtensible Markup Language). If you’ve ever edited an
HTML file, XML will look extremely familiar! It consists of tags sur-
rounded by angle brackets (<>) and following a specific structure.
Here’s a very simple example launchd item:
• The first four lines (the ones starting with <?xml, <!DOCTYPE, <plist,
and <dict>) and the last two lines (</dict> and </plist>) are always
going to be exactly the same in every launch item, so you can simply
copy and paste them, but otherwise, you don’t have to worry about
their contents.
242
ple, three pairs of lines—each one a key (something surrounded by
<key> </key> tags) and a value (whatever comes immediately after
the key).
• The first key, which is mandatory, is Label. It tells macOS what the
name of the action is. The name is specified in the following line,
between <string> </string> tags, and you’ll notice that it looks like
a backwards domain name. That’s because it follows reverse do-
main notation. In reality, this string can be anything you like, as
long as it’s unique on your computer.
You don’t have to own a domain name, and Apple isn’t going to
check to see that it’s formatted correctly. But, just so it’s easier to
find your own launchd items, I suggest naming them all with the
same starting bit—for example, local.joe or com.yourname. The last
bit, after the fake domain name and a period, identifies this specific
launchd item. Here, it’s just example.
Note: When you save the file, you should give it the same name as
its label, but add .plist to the end. So this text file would have the
filename com.takecontrolbooks.example.plist.
243
• The final key in this example is RunAtLoad, which predictably tells
this launchd item to run the program when the item loads. (Remem-
ber, when it loads is determined by where the .plist is stored.)
Since RunAtLoad is a Boolean (yes/no) value, it’s not followed by a
string but rather by <true/>, which simply says, yes, do run this
when the item loads.
Not too bad, right? If you created a file like that and stored it in
~/Library/LaunchAgents, macOS would load it when you log in and,
because they only parameter we set concerning when it should run was
RunAtLoad, it would run the test.sh script and then become dormant
until the next time you log in. (Refer to the list a few pages back for
other places you might store the file.)
So far so good, but what if you want to do something just a wee bit
fancier? Launchd has dozens of options, and I’ll mention just a few
major ones to get you started.
open -e /Users/jk/Desktop/example.txt
Although that would work fine in Terminal (assuming you had a file
with that name in that location), it wouldn’t work in a launchd item
unless you wrote it like this:
244
<key>ProgramArguments</key>
<string>/usr/bin/open</string>
<string>-e</string>
<string>/Users/jk/Desktop/example.txt</string>
So, not only does each element that’s preceded by a space require a
separate line, but we must also start by specifying the full pathname
for the program itself (in this case, /usr/bin/open).
Open an App
Ordinary apps on your Mac, such as those stored in your Applications
folder, are not single files (even though they appear to be). In reality,
they’re special folders called bundles, containing a bunch of other files
and folders.
As such, launchd can’t run an app simply by pointing to the app’s name
as it appears in the Finder, because—going back to the rule that path-
names must be complete—launchd requires the path to the actual
executable file within the app bundle, and that pathname must also
include the app’s full name with extension.
For example, in the Applications folder you’ll find Mail, but if you were
to turn on extensions (by going to Finder > Settings/Preferences >
Advanced and checking “Show all filename extensions”), you’d see it’s
really Mail.app. If you then dug through the package contents you’d
find that the executable, called Mail, is nested two levels deep inside
Contents/MacOS. Even then, because Mail is part of macOS, it’s not
really stored in /Applications (even though its icon appears there), but
rather in /System/Applications!
So, the full path to Mail, if you wanted to open it with launchd, would
be /System/Applications/Preview.app/Contents/MacOS/Preview.
But wait! If you enter that pathname as a program value, you’ll get an
error message, because…launching a GUI app like preview requires the
245
use of the open command along with the -a flag! And so, because that’s
a command-line program with arguments, the actual command to
open Mail would be:
<key>ProgramArguments</key>
<string>/usr/bin/open</string>
<string>-a</string>
<string>/System/Applications/Mail.app/Contents/MacOS/Mail</string>
All that to say: launchd can absolutely launch regular apps, but in order
to find the executable file, you might have to do a bit of exploring.
<key>WatchPaths</key>
<array>
<string>/full/path/to/folder_or_file</string>
</array>
If the pathname is for a single file, the program runs when that file is
created, deleted, or modified. If the pathname is for a folder, the
program runs when the folder is created or deleted, and when any file
in the folder (at the top level only) is created, deleted, or modified.
Note: If you use WatchPaths, you’ll most likely want to omit RunAtLoad
(or set it to <false/>).
246
<key>KeepAlive</key>
<dict>
<key>Crashed</key>
<true/>
</dict>
Notice that it’s not merely a question of whether to keep the program
alive, but one that requires the additional parameter of Crashed (which,
since it’s set to true, means that the program has indeed crashed).
Launchd can also check for other states that would cause the program to
reopen, such as another program running or the availability of a
certain network. Refer, again, to launchd.info for details.
Run at an Interval
Instead of (or in addition to) running when the launchd item loads,
would you like your program to run every minute, hour, day, or other
regular interval? Add this:
<key>StartInterval</key>
<integer>3600</integer>
The integer you enter (replacing 3600) is the number of seconds be-
tween launches. So, use 3600 to open something every hour, 86400 to
open it once a day, and so on.
Note: You can also schedule jobs to run at specific times and dates;
see launchd.info for how to format those.
But.
What if you’re writing a new launchd item and you want to test it, like,
right now? Knowing how difficult it can be to get all the tags exactly
247
right, you probably don’t want to be forced to restart or log out/in
repeatedly just to test it. Surely there must be a way of telling macOS to
load an item immediately, right? Indeed there is; likewise, there’s a
way to tell launchd to unload an item that would otherwise keep run-
ning indefinitely (or until the next restart/login).
To do things like that, you’ll have to open Terminal and use a com-
mand called launchctl (for “launch control”). Just explaining all the ins
and outs of launchctl could take many pages, and by this point you’re
probably wondering when I’m going to let you off the hook and tell you
about nice, friendly GUI apps for controlling launchd items (which is
very soon). So I’m just going to explain a few basic commands here.
However, if you want to load a launch daemon, you’ll instead use this:
Let me say a few words about that funny-looking string gui/`id -u`.
The gui part tells launchd what kind of login ID follows it, while the
part after the slash is supposed to be your numeric user ID (not your
username). You do know your numeric ID, right? No? Well, if you’re
the only user on your Mac, there’s a pretty good chance it’s 501, in
which case you could say bootstrap gui/501 …. But it might not be! So,
`id -u` allows you to carry out a tiny command within the command:
248
all it does is spit out the numeric ID of the current user. The output of
`id -u` is a number that’s swapped in and directly interpreted by
launchctl. Finally, note that those are backticks (`), on the same
keyboard key as the tilde (~), not apostrophes!
The reason you don’t need all that with launch daemons is that they
run as the root user, and you use system/ as a shortcut to say that.
To unload a launchd item, use exactly the same system, but replace
bootstrap with bootout. For example:
As above, replace the filename as necessary. (Notice that you don’t use
the full pathname for starting or stopping, and that there’s no space
before the filename.)
249
using launchd items manually. (And remember, I’ve only barely
scratched the surface here!) If, on the other hand, you’re an ordinary
mortal from Earth with an extra twenty bucks, you can save yourself a
tremendous amount of time and effort by picking up one these:
250
Both apps are excellent, helping you unlock the power of launchd and
saving you from making mistakes. They approach this task in different
ways, and one or the other might appeal to you more. You can down-
load trial versions of each and decide for yourself which you prefer. (I
personally gravitate toward Lingon X, which I’ve used for many years,
but that’s just a matter of taste.)
In either case, you can create launchd items by filling in a simple form,
checking some boxes, and choosing menu commands. You can also
load, unload, start, and stop items without having to learn any arcane
command-line incantations. And you can also control—and, in some
cases, edit—launchd items supplied by other apps.
251
Use Omni Automation
Earlier in this book, I covered a number of apps with built-in au-
tomation tools, such as Microsoft Office and Nisus Writer Pro (see
Automate Individual Apps). I also told you about systemwide plat-
forms such as AppleScript (see Get Started with AppleScript) and
JavaScript for Automation (see Using JavaScript for Automation),
which can be used both for automating individual apps and for cross-
application scripting.
Pro versions of apps made by the Omni Group can already be automat-
ed in any of these ways. Those include OmniFocus Pro (a task manage-
ment app), OmniGraffle Pro (a graphing and charting app), OmniOut-
liner Pro (an outlining app), and OmniPlan Pro (a project management
app). Thus it may seem strange that I’m addressing them in a separate
chapter.
252
time, there’s a way to get sort of a little bit close-ish on iOS/iPadOS to
what you’ve been able to do for years with AppleScript on a Mac—and
you can write for both platforms at the same time.
Second, the most exciting part of Omni Automation is what it does for
iOS/iPadOS—but this book isn’t about iOS/iPadOS automation, except
in a tangential sense.
Even so—and even if you look only at the Mac side—Omni Automation
offers some terrific capabilities:
In case you don’t already use OmniFocus Pro, OmniGraffle Pro, Omni-
Outliner Pro, and/or OmniPlan Pro—or if you do, but you’re having
trouble visualizing how these capabilities could be put to practical
use—let me offer some examples of what you could do with Omni
Automation:
253
• Sort an outline, or retitle columns based on the results of a mathe-
matical calculation.
• Use data from a table on the web to color-code a U.S. map by state
in OmniGraffle Pro.
• Import the text from an OmniOutliner Pro document into a text box
in OmniGraffle Pro.
You can learn all about Omni Automation, and see exactly how to do
most of these tasks, on the Omni Automation website. The site was
built by the estimable Sal Soghoian, who was formerly in charge of
automation technologies at Apple (see The State of Mac Automation).
It features numerous videos, tutorials, code samples, and other docu-
mentation to get you started.
Although I don’t want to reiterate all that material here, I would like to
offer just a couple of examples of what Omni Automation can do and
how you can get started. Since this is a book about Mac automation, I’ll
be using the Mac version of OmniGraffle Pro for my examples, but the
iOS/iPadOS version is nearly identical, and OmniOutliner offers a
comparable set of features on both platforms.
254
Security and iOS/iPadOS Automation
As I hinted earlier, one of the barriers to systemwide automation on
iOS/iPadOS is the way apps are sandboxed, or isolated from each
other, to prevent hacking, malware damage, and other problems.
That’s just one of numerous restrictions Apple places on iOS/iPadOS
developers in the name of security. Of course, security is an excellent
and admirable goal, so it’s worth wondering whether Omni Au-
tomation somehow subverts these protections.
The short answer is: no. Omni Automation was designed with security
as a prime consideration. Whenever a script is executed that operates
outside an Omni app (including scripts that let OmniGraffle Pro and
OmniOutliner Pro talk to each other, and scripts embedded in URLs),
there’s a review process—you, the user, must explicitly agree to each
and every script usage. (For that matter, Apple would not have
approved the iOS/iPadOS versions of the apps for sale in the App
Store if the company did not believe they contained adequate protec-
tions.)
Even so, it’s never wise to underestimate the creativity of people who
create and distribute malware, so you should install plugins only from
trusted sources—and exercise common sense when tapping links or
pasting in JavaScript code, too.
255
Figure 81: A basic shape in OmniGraffle Pro.
2. With the shape still selected, choose Edit > Copy As > JavaScript.
This puts the code needed to draw that shape on your clipboard.
3. Now press Delete to delete that shape from your document. (Don’t
worry, we’ll bring it back in a moment.)
5. Click in the field at the bottom of the window, and choose Edit >
Paste (⌘-V) to paste the JavaScript code in (Figure 82).
256
Figure 82: The JavaScript code for a shape in the console window.
7. Now it’s time to play. Try entering these commands, one at a time
(pressing Return after each one), and observing the results:
The end result should look something like Figure 83. You can, of
course, play with any attributes you like—and follow similar steps to
discover how to draw other objects.
257
Figure 83: Your final shape after altering it with JavaScript.
258
Use a Macro Utility
Earlier in this book, I discussed Shortcuts, Automator, and Apple-
Script, three tools that can control numerous other apps and tie multi-
ple actions together into easy-t0-run shortcuts. All those technologies
are powerful, free, and included with macOS.
But AppleScript’s learning curve precludes casual use, while it’s limited
by the capabilities various apps choose to expose. Automator and
Shortcuts are far easier for a beginner to use, but they, too, have fairly
constrained palettes of capabilities—and not all the tasks you might
wish to automate fit their “workflow” mold. Meanwhile, apps like Excel
and Nisus Writer Pro have fantastic automation capabilities built in,
but they’re largely confined to activities within those apps.
So we come to a category of automation tools that—at the risk of
overstating my case—transcends these limitations. If you just want to
get the job done—not necessarily in the most programmatically elegant
way but in a fast, reliable, and flexible way—you want a macro utility.
It’s the sort of tool I reach for most often for general-purpose au-
tomation tasks.
Like other kinds of tools covered in this book, the idea of a macro
utility is straightforward. You pick an action, or a series of actions,
from a list; these form the macro’s task. Then you pick one or more
events to trigger that action—a keyboard shortcut, a button click, a
change in network settings, or whatnot. That’s it: you have a macro.
259
the visible interface, simulating button presses, menu commands,
keystrokes, and mouse movements.
Put all this together and you have a toolkit that—with a bit of clever-
ness and patient testing—can automate almost any repetitive Mac task
that doesn’t require creativity or human intuition. Here are just a
handful of examples, all of which can be done with a single click or
keystroke:
• Email the URL of the web page you’re currently viewing to someone
else
Having sung the praises of macro utilities generally, I must level with
you. For all practical purposes, we’re talking about one utility: Key-
board Maestro. Sure, I’ll mention a few other apps—see Use Another
Macro Utility—and I noted earlier that BetterTouchTool has macro-
like capabilities (see Use BetterTouchTool). Those other apps definitely
have their place, but if you want a great macro utility for your Mac,
Keyboard Maestro is (in my professional opinion) the best option by
far.
260
Control Your Mac with Keyboard Maestro
I’ve already given you a taste of what Keyboard Maestro can do, so let
me show you what it looks like, walk you through creating a couple of
macros, and explore some of its options and little-known features.
Create a Macro
When you open the Keyboard Maestro (Figure 84), you’ll see a three-
pane Editor interface. On the left is a list of groups, which you can use
to organize your macros however you like; this includes the All Macros
smart group. In the middle is the list of all the macros in the current
group. And on the right is the contents of the currently selected macro
(or a blank shell of a macro, if you’ve just created it). To create an
empty macro, click the plus button at the bottom of the Macros list.
Figure 84: The Keyboard Maestro editor with a new, blank macro
ready to be customized.
Within the macro pane (Figure 85), you see two areas: the trigger(s)
(top) and the action(s) (bottom). You can configure these two items in
any order. A trigger is what you do to make the macro run—a key-
stroke, a menu command, or a system event, say. (More about triggers
in a moment.) The action(s) are what happen when the trigger occurs.
261
Figure 85: The macro pane includes trigger and action areas.
Note: The icons that appear next to macro names may differ from
what you see here, but that’s irrelevant—they’re just for decoration.
Let’s walk through a few macros to see how it’s all done.
3. Click New Trigger to display a pop-up menu from which you can
choose any of 20 trigger types. Choose Hot Key Trigger (the first
item) from this menu to use a keyboard shortcut as the trigger.
262
4. You’ll notice that the Type field under the text “This hot key” is
already selected. So press the keyboard shortcut you want to use to
trigger this macro. It can be anything you like, but I suggest choos-
ing something obscure that isn’t already being used for something
else, like ⌘-Option-Control-L.
Note: A macro can have more than one trigger, and you can change
your trigger(s) at any time.
5. Click New Action to display a new pane (which covers the two left-
most columns of the window) with a list of all possible actions,
grouped by category (Figure 86).
263
From here, the instructions diverge depending on which version of
macOS you’re running.
In Ventura or later:
6. The first action is to open the System Settings app.
To solve this problem, drag the Pause Until action (from the Control
Flow category) underneath the Activate System Settings action.
Click New Condition and choose Front Window Condition from the
pop-up menu. Then, from the Front Application pop-up menu,
choose System Settings (if it’s not already there, click More at the
bottom to expand the list). Leave the last pop-up menu set to Exists.
264
Figure 87: The final Open Login Items macro for Ventura or later, in
edit mode.
9. Click the Edit button at the bottom to deselect it. (The macro will
work fine even if you don’t leave edit mode, but doing so keeps you
from making accidental changes to your macro.) Once you’re no
longer in edit mode, the macro should look like Figure 88.
265
Figure 88: The final Open Login Items macro for Ventura or later.
In Monterey or earlier:
6. The first action is to open the User & Groups pane of System
Preferences.
To do this, click Open in the Categories list and then drag Open a
System Preference Pane to the “No Action” label on the right (or
just double-click the action). If Users & Groups isn’t already shown
next to “Open preference pane,” choose it from the pop-up menu.
So, drag the Pause Until action (from the Control Flow category)
underneath the Open Users & Groups Preference Pane action. Click
New Condition and choose Front Window Condition from the pop-
up menu. Then, from the Front Application pop-up menu, choose
System Preferences (if it’s not already there, click More at the
bottom to expand the list). Leave the last pop-up menu set to Exists.
266
8. Now we need to switch to the Login Items view (in case that’s not
what the window is currently set to).
Click Interface Control in the Categories list, and add the Press a
Button action to the end of your action list. Replace the text OK with
Login Items. At this point, the macro should look like Figure 89.
Figure 89: The final Open Login Items macro for Monterey or
earlier, in edit mode.
267
9. Click the Edit button at the bottom to deselect it. (The macro will
work fine even if you don’t leave edit mode, but doing so keeps you
from making accidental changes to your macro.) Once you’re no
longer in edit mode, the macro should look like Figure 90.
Figure 90: The final Open Login Items macro for Monterey or earlier.
268
Note: I abbreviate most of the following steps; for more details refer
to the instructions for the previous example.
3. Add your first action—Prompt for User Input (in the Variables
category)—which will prompt you, the user, to choose a destination
file format.
4. Fill in Convert Format for the Title, and in the Prompt field, type
Choose the format you want to convert the selected file(s) to.
Must be one of: txt, html, rtf, rtfd, doc, docx, wordml, odt,
webarchive.
5. Click the plus button under Variables and Default Values to add
a new variable. Enter To in the first field (the variable’s name) and
html in the second field (its default value).
6. Next, tell the macro that it should operate on whichever file(s) you
happen to have selected in the Finder: add the For Each action (in
the Control Flow category) to the end of your action list. Replace the
text Variable in the For Each field with filePath. Click the plus
button next to New Collection, and choose Finder’s Selection Collec-
tion from the pop-up menu.
7. Finally, it’s time to add the shell script. But it’s not an independent
action; rather, it’s part of the For Each action—that is, the shell
script will run on each item you selected in the Finder. Add an
Execute a Shell Script (from the Execute category) into the No
Action area (surrounded by a dotted line) at the bottom of the For
Each action. In the field that appears there, type this:
269
Figure 91: The final Convert Format macro, in edit mode.
270
8. Optional but recommended: click the Edit button at the bottom to
deselect it.
Now you can run the macro, but first you’ll need at least one document
somewhere in one of the supported formats (from step 6 above). I
suggest copying one or more such files to your Desktop to make them
easier to work with.
One last thing before we run the macro: if Keyboard Maestro’s status
or menu isn’t visible in your Mac’s menu bar, switch back to
Keyboard Maestro, go to Keyboard Maestro > Settings/Preferences >
General and make sure Display Status Menu is set to either Alphabeti-
cally, By Group, or Hierarchically (i.e., not Never).
Now select the file(s) you want to convert. Then, choose Convert
Format from the Keyboard Maestro status or menu. You should
see the dialog (which you created!) (Figure 92).
Figure 92: This dialog should appear when you run your macro.
Leave the To field set to its default, and click OK. A new file should
appear with the same name and location as the old file (which will still
be there) but with the .html extension—and it’ll be in HTML format!
(Feel free to run the macro as often as you like, with different To
settings and different files selected to see how it works.)
271
it runs, it selects all the text on the current line up to and including the
insertion point and converts that text to title case (like the heading just
above this paragraph). But the trigger is just typing a few characters.
Follow these steps (refer to Macro #1: Open Login Items for details):
3. The first action simulates the keystrokes needed to select text from
the insertion point back to the beginning of the line. To do this, add
the Type a Keystroke action (from the Interface Control category).
Then click in the Simulate Keystroke field and type ⌘-Shift-←.
4. Next, we want the macro to pause for half a second, to allow that
action time to complete. To do this, add a Pause action (from the
Control Flow category). Fill 0.5 in the blank.
5. Now we want to copy the selected text to a special clipboard (so that
the main clipboard isn’t overwritten). To do this, add a Copy to
Named Clipboard action (from the Clipboard category). From the
second pop-up menu, choose New. Type the name Title Case, and
close the window. Title Case should then automatically be selected
in that pop-up menu.
272
Your macro should now look like Figure 93. (I’ll skip the step of
turning off edit mode and showing you what that version looks like,
although you can do that if you like.)
To run this macro, make sure your insertion point is at the end of a
line. Then type cttc (without any modifiers). The macro runs, and your
trigger characters disappear.
273
Macro #4: Paste Previous Clipboard
I told you Keyboard Maestro includes a clipboard history. One of my
favorite ways to use this is to press a keystroke that pastes whatever
was on my clipboard just before the current thing. So, if I copy and
paste something, copy a second thing, but then want to paste the first
thing again, this is what I use.
2. Assign the macro a hot key trigger of ⌘-Control-V (or whatever you
like).
3. Add two actions: Set Clipboard to Past Clipboard (from the Clip-
board category), with System Clipboard chosen from the Set menu
and 1 entered as the number of the clipboard; and Type a Keystroke
(from the Text category), with ⌘-V entered as the keystroke. The
result should look like Figure 94.
274
With this macro enabled, simply press ⌘-Control-V to paste the
previous contents of the clipboard.
Record a Macro
If you read Automate Microsoft Office, you may recall that in Office
apps, you can record a macro. In other words, Office will watch you
while you perform activities, and then make them into a macro. You
can play this macro back later, no coding required. Keyboard Maestro
offers a similar feature. It won’t always produce results as reliable as
those you get creating your own macro from scratch—and not every
kind of macro can be recorded—but it’s a simple way to ease into
macro construction or get unstuck if you’re stuck.
To record a macro:
Figure 95: This floating window appears when you record a macro.
The countdown timer (left) gives way to the icon on right when it
reaches zero.
3. Once the timer has counted down to zero and the icon says Record-
ing, do stuff. Whatever you like. Switch apps, type some text, apply
formatting, choose menu commands, click buttons, anything. You
know, stuff.
275
5. Optional but recommended: click Edit to leave edit mode.
Now try running your macro. If the macro doesn’t work as expected—
which is likely—go back and click Edit to return to edit mode and see if
you can modify some of the actions to do what you want them to do.
You may also need to add Pause or Pause Until actions to force the
macro to wait for your Mac to catch up with it at certain points.
276
• Find Image on Screen (Image category): This blew my mind
when I first saw it. Keyboard Maestro can identify an area on your
screen matching an image (perhaps a cropped screenshot) that you
supply, and having found that portion of your screen, it can high-
light it, move the mouse to it, or take other actions.
277
Learn About Keyboard Maestro Triggers
Just as Keyboard Maestro has lots of nifty actions, it has a crazy array
of triggers. We’ve seen keyboard shortcuts and commands on the
Keyboard Maestro status menu, but there are 29 other options too. I’m
not going to enumerate all of them here—you can read all about them
in the Keyboard Maestro documentation—but I want to call out a few
that I think are especially noteworthy:
• Time Trigger: Have your macro run on a timer! This trigger lets
you select the time and day(s) of the week you want it to run.
278
Figure 96: The macro palette is normally unobtrusive (left), but
when you mouse over it, it expands to show macros you can activate
with a click.
279
That’s not to say Alfred workflows aren’t extremely useful—they are.
With a few keystrokes in Alfred, you can create a new note or search
in Evernote, perform a search on multiple websites at once, or open
a selected image in a browser instead of Preview. But they require a
particular way of thinking about tasks that doesn’t match the way
my brain works, so I find it difficult to recommend them.
yKey doesn’t include logic, as such. For example, it can wait for
certain app or window states before moving on with the next step in
a macro, but it can’t make if/then/else decisions, process variables,
perform loops, search for text patterns, or evaluate complex condi-
tions as Keyboard Maestro can. And its interface is odd—it strikes
me as being backward from the way most macro utilities approach
triggers and actions. Finally, and most seriously, it hasn’t yet been
updated to support Monterey, so its future seems iffy.
Farewell, ControlPlane
At this point in earlier versions of the book, I covered a wonderful
utility called ControlPlane, which used settings or situations known as
contexts to trigger various types of automations.
For example, I could configure it to launch a certain app whenever I
connected my MacBook Pro to AC power, and quit that whenever I
unplugged my Mac. It could rearrange my windows in a particular
way when I connected a second display, and it could switch my Mac’s
audio input whenever I plugged in external speakers.
Unfortunately, at some point since the previous version of this book,
the ControlPlane website went offline, and as far as I can tell, the app
has been discontinued.
280
About This Book
Thank you for purchasing this Take Control book. We hope you find it
both useful and enjoyable to read. We welcome your comments.
Ebook Extras
You can access extras related to this ebook on the web. Once you’re on
the ebook’s Take Control Extras page, you can:
• Download any available new version of the ebook for free, or buy a
subsequent edition at a discount.
• Access the book in both PDF and EPUB formats. (Learn about
reading on mobile devices on our Device Advice page.)
• Read postings to the ebook’s blog. These may include new informa-
tion and tips, as well as links to author interviews. At the top of the
blog, you can also see any update plans for the ebook.
If you bought this ebook from the Take Control website, it has been
automatically added to your account, where you can download it in
other formats and access any future updates.
281
About the Author and Publisher
In his hypothetical spare time, Joe likes to travel, walk, cook, eat, and
practice t’ai chi. He lives in Saskatoon, Saskatchewan, Canada, with
Morgen, their sons, and their cat. To contact Joe about this book, send
him email and please include Take Control of Automating Your Mac in
the subject. You can also sign up for joeMail, his low-volume mailing
list, visit his blog at JoeKissell.com, or follow him on Mastodon
(@joekissell).
Acknowledgments
Bill Cheeseman and Sal Soghoian offered invaluable input and sug-
gestions for an earlier edition of this book. I also appreciated the
helpful feedback of all the technical reviewers of the first edition—
especially Peter N Lewis and Greg Scown. And I’m grateful to all the
282
developers who generously provided the coupons at the end of this
book. Thank you!
Credits
• Publisher: Joe Kissell
• Editor: Glenn Fleishman
• Cover design: Sam Schick of Neversink
• Logo design: Geoff Allen of FUN is OK
283
Copyright and Fine Print
Take Control of Automating Your Mac, Fifth Edition
ISBN: 978-1-990783-47-0
Copyright © 2024, Joe Kissell. All rights reserved.
alt concepts, 419 8B-3110 8th St. East, Saskatoon, SK S7H 0W2 Canada
Why Take Control? We designed Take Control electronic books to help readers regain
a measure of control in an oftentimes out-of-control universe. With Take Control, we also
work to streamline the publication process so that information about quickly changing
technical topics can be published while it’s still relevant and accurate.
Our books are DRM-free: This ebook doesn’t use digital rights management in any
way because DRM makes life harder for everyone. So we ask a favor of our readers. If you
want to share your copy of this ebook with a friend, please do so as you would a physical
book, meaning that if your friend uses it regularly, they should buy a copy. Your support
makes it possible for future Take Control ebooks to hit the internet long before you’d find
the same information in a printed book. Plus, if you buy the ebook, you’re entitled to any
free updates that become available.
Remember the trees! You have our permission to make a single print copy of this
ebook for personal use, if you must. Please reference this page if a print service refuses to
print the ebook for copyright reasons.
Caveat lector: Although the author and alt concepts have made a reasonable effort to
ensure the accuracy of the information herein, they assume no responsibility for errors or
omissions. The information in this book is distributed “As Is,” without warranty of any
kind. Neither alt concepts nor the author shall be liable to any person or entity for any
special, indirect, incidental, or consequential damages, including without limitation lost
revenues or lost profits, that may result (or that are alleged to result) from the use of these
materials. In other words, use this information at your own risk.
It’s just a name: Many of the designations in this ebook used to distinguish products
and services are claimed as trademarks or service marks. Any trademarks, service marks,
product names, or named features that appear in this title are assumed to be the property
of their respective owners. All product names and services are used in an editorial fashion
only, with no intention of infringement. No such use, or the use of any trade name, is
meant to convey endorsement or other affiliation with this title.
We aren’t Apple: This title is an independent publication and has not been authorized,
sponsored, or otherwise approved by Apple Inc. Because of the nature of this title, it uses
terms that are registered trademarks or service marks of Apple Inc. If you’re into that sort
of thing, you can view a complete list of Apple Inc.’s registered trademarks and service
marks.
284
Also by Joe Kissell
Click any book title below or visit our web catalog to add more ebooks
to your Take Control collection!
Take Control of Apple Mail: Learn the ins and outs of Apple’s email
app in macOS and iOS.
Take Control of Backing Up Your Mac: Protect your Mac’s valuable
data from any sort of mishap.
Take Control of DEVONthink 3: Master this powerful information
management tool.
Take Control of Ventura: Discover what’s new in macOS 13 and get all
the information you need to upgrade safely.
Take Control of the Mac Command Line with Terminal: Master your
Mac’s command-line interface and learn basic Unix skills.
Take Control of Your Online Privacy: Learn what’s private online (not
much)—and what to do about it.
Take Control of Your Paperless Office: With your Mac, scanner, and
this ebook in hand, you’ll finally clear the chaos of an office overflow-
ing with paper.
285
Hazel Coupon
To save 20% on Hazel, visit the Noodlesoft Store page to see the
discount pricing, enter how many copies you want, and check out.
286
Keyboard Maestro Coupon
To save 20%, visit the Keyboard Maestro website and be sure to input
the coupon code TCOAYM as you check out.
287
LaunchBar Coupon
To save 20%, go the Objective Development Shop page, add Launch-
Bar to the cart, and enter DT-4460-7113 in the Discounts field.
288
Nisus Writer Pro Coupon
To save 25% on Nisus Writer Pro, visit the Nisus Software Take Con-
trol Readers page and click the appropriate Buy button.
289
Script Debugger Coupon
To save 15% on Script Debugger, use this URL to automatically apply
discount code TAKECONTROL17.
290
TypeIt4Me Coupon
To save 30% on TypeIt4Me, visit the Ettore Software coupon page and
click Buy Now.
291
Typinator Coupon
To save 30%, go to the Ergonis Store page, add Typinator to your cart,
and enter coupon code TCO-TYPINATOR.
292