Skip to content

Mac OS X Hints

Updated: Find Keyboard Maestro macros by shortcut

Note: Revised on December 4, 2018 with a much better implementation of the pop-up palette, and some changes in timing and mouse movement.

One of the "problems" with Keyboard Maestro is that it's so useful I use it a lot, leading to a large collection of macros. Due to the number of macros, sometimes when I want to add a new shortcut, I can't remember if I've used that shortcut before or not. Today's tip comes in two flavors to address that problem: Simple and Complex.

The Simple solution

Short of just trying the shortcut, there's a way to check from within Keyboard Maestro itself: Type the macro's activation keys into the search box, as seen in the box at right.

You can't do this by pressing the actual shortcut keys—you have to type their character representations. You can do this with the "Show Emoji & Symbols" option under the flag icon in the menu bar, if you've enabled it in the Keyboard System Preferences panel. But finding those few special keys (if you even know how to search for them) is a pain.

Technically, you could also use the pop-up character palette macro I wrote, except there's an issue: When the palette activates, it deactivates the search box, so the characters don't make it there. It's also overkill for this task, because there are characters that wouldn't be part of keyboard shortcuts, and you'd never need the HTML codes, just the characters.

So I wrote what wound up being a set of new macros that make searching for assigned keyboard shortcuts much easier.

[continue reading…]



A quick-toggle solution for macOS’ translucency feature

Note: This was originally published in 2015; I've updated it with a minor change required for Mojave, and clarified a bit of the text. Further note: There's now an updated script that works in Sonoma.

macOS includes—and enables by default—translucency, which gives you 'wonderful' effects such as this in Calculator:

This is just one example; lots of other apps (Mail and Messages, to name two) contain panes that become grossly distorted by background color bleed-through. I'm not sure who at Apple (Marketing?) thinks this feature is good for productivity , but I find it completely distracting.

As a result, I turn off translucency on every Mac I own. You can do so yourself in System Preferences > Universal Access > Display. Just check the Reduce transparency* box, and you won't get any more bleed-through. (You'll also get a solid Dock, and perhaps the world's ugliest Command-Tab task switcher. Such is the cost of usability.)

* It's ridiculous that Apple calls this transparency, which is defined as "the condition of being transparent," and being transparent means being see-through, clear, invisible, etc. This is clearly translucency, or "allowing light, but not detailed images, to pass through." But I digress…

However, when writing for Many Tricks or Macworld, I often need to take screenshots. And because most users won't disable translucency, I prefer to take those screenshots with translucency enabled, so that they're closer to what most users might see. That means a trip through System Preferences to toggle the checkbox, which gets annoying after the second or third time you've done it.

There had to be an easier way—and after some missteps, I eventually found it.

[continue reading…]



Easily see any app’s bundle identifier

I occasionally need to help one of our customers get the bundle identifier for a given app, for some purpose with one of our apps. While the task isn't complicated—the value is stored in a file named Info.plist within each app bundle—it's not something that's necessarily easy to explain to someone who doesn't have a lot of Mac experience.

I figured there must be a less-complicated solution, and I was right, though it's probably higher on the geek factor. After some searching, I found this thread at Super User, which offers a number of solutions. The simplest—and always working, in my experience—was the very first one: Open Terminal and run this command:

osascript -e 'id of app "Name of App"'

The "Name of App" is replaced with the name of the app as it appears when hovering over its Dock icon. For Excel, for example, it'd be:

osascript -e 'id of app "Microsoft Excel"'

Run that command, and it returns com.microsoft.Excel, which is just what I need—I just have the customer copy the output and email it back to me.



Find and fix non-searchable PDFs

I use a ScanSnap ix500 scanner to scan a lot of paper into PDFs on my iMac. And thanks to the ScanSnap's bundled optical character recognition (OCR), all of those scans are searchable via Spotlight. While the OCR may not be perfect, it's generally more than good enough to find what I'm looking for.

However, I noticed that I had a number of PDFs that weren't searchable—some electronic statements from credit cards and utility companies, and some older documents that predated my purchase of the ScanSnap, at least based on some tests with Spotlight.

But I wanted to know how many such PDFs I had, so I could run OCR on all of them, via the excellent PDFPen Pro app. (The Fujitsu's software will only perform OCR on documents it scanned.) The question was how to find all such files, and then once found, how to most easily run them through PDFPen Pro's OCR process.

In the end, I needed to install one set of Unix tools, and then write two small scripts—one shell script and one AppleScript. Of course, you'll also need PDFPen (I don't think Pro is required), or some other app that can perform OCR on PDF files.

[continue reading…]



View app-specific log messages in Terminal

March 29 2018 Update:

When this tip was first posted, it didn't work right: The log command ignored the --start, --end, and --last parameters. Regardless of what you listed for parameters, you'd always get the entire contents of the log file. I'm happy to note that this has been resolved in macOS 10.13.4, as log now functions as expected:

$ log show --last 20s --predicate 'processImagePath CONTAINS[c] "Twitter"'
Filtering the log data using "processImagePath CONTAINS[c] "Twitter""
Skipping info and debug messages, pass --info and/or --debug to include.
Timestamp                       Thread     Type        Activity             PID    TTL  
2018-03-30 09:26:15.357714-0700 0xc88a8    Default     0x0                  5075   0    Twitterrific: (CFNetwork) Task <9AD0920A-7AE7-4313-A727-6D34F4BBE38F>.<250> now using Connection 142
2018-03-30 09:26:15.357742-0700 0xc8d7a    Default     0x0                  5075   0    Twitterrific: (CFNetwork) Task <9AD0920A-7AE7-4313-A727-6D34F4BBE38F>.<250> sent request, body N
2018-03-30 09:26:15.420242-0700 0xc88a8    Default     0x0                  5075   0    Twitterrific: (CFNetwork) Task <9AD0920A-7AE7-4313-A727-6D34F4BBE38F>.<250> received response, status 200 content K
2018-03-30 09:26:15.420406-0700 0xc8d7a    Default     0x0                  5075   0    Twitterrific: (CFNetwork) Task <9AD0920A-7AE7-4313-A727-6D34F4BBE38F>.<250> response ended
 --------------------------------------------------------------------------------------------------------------------
Log      - Default:          4, Info:                0, Debug:             0, Error:          0, Fault:          0
Activity - Create:           0, Transition:          0, Actions:           0
$

This makes it really easy to get just the time slice you need from the overly-long log files. You can use s for seconds, m for minutes, h for hours, and d for days as arguments to these parameters.

This article provides a nice overview on interacting with log and predicates to filter the output—there's a lot you can do to help figure out what might be causing a problem.

And now, here's the rest of the original post…

[continue reading…]



Sorting—or not—bookmarks in Safari in macOS 10.13.4

One of the unpublicized nuggets in macOS 10.13.4 is this little doozy in the release notes:

Enables sorting Safari bookmarks by name or URL by right-clicking and choosing 'Sort By…'

This has been a feature request for nearly as long as Safari has existed—Safari was released in January 2003, and I found this MacRumors forum thread from April 2003 asking how to sort bookmarks. So this feature was nearly 15 years in the making!

Sure enough, right click on an entry in your Bookmarks list, and you can sort by name or URL:

I have a junk drawer in Safari where I bookmark stuff that I might someday want. Like a real junk drawer, it gets filled pretty quickly, and sorting the entries is a great way to trim the out of date entries. But when I tried to sort my junk drawer…

…there was no such option available. Stumped for a moment, it struck me that there may be a limit on the number of entries, as that was the only difference between this folder and others. I removed half the entries, leaving 546, but still, no Sort entry in the contextual menu.

After a bunch of back-and-forth moving (which takes some time, when you move hundreds of bookmarks around), I found the limit: 450 entries.


So if you have a large folder of bookmarks in Safari that you need to sort, you'll have to split it into multiple folders, none of which can have more than 450 entries. Weird but true.



How to rename dropped pins in macOS Maps

Today I wanted to do something that seemed simple: Add a pin to Apple's Maps app on macOS High Sierra, then rename the pin.

But after trying everything obvious, I was stumped, and took to both Twitter and web searching. About the same time I found the answer on the web, I also received a tweet from @tmneff with the same answer.

This seems absolutely crazy, but here's how you name a dropped pin in Maps on macOS—these are just the instructions from the linked web page, with a few added screenshots:

  1. Drop the pin.

  2. When the info box appears, click the small circled 'i' at the right.

  3. In the new window that appears, click the heart (Favorite) icon, to make your new pin a favorite.

  4. Click in the search bar, then highlight the Favorites entry and click it.

  5. When the list of favorites appears, you'll see an Edit box at the lower right corner; click that, and you can then click-and-edit any of the pin names as you would a filename in Finder.

    You can also delete favorites here by clicking the 'x' icon.

  6. Click Done, and your custom name should be saved with the dropped pin.

Apparently in iOS, you're prompted for a name when you tap the Favorite icon—that makes a lot sense, and macOS should follow the same convention. But it doesn't, sigh.



Show albums a given Photos’ photo has been added to

A friend asked if there was a way in Photos to see which albums a selected photo had been added to. This is one of those things that would be incredibly easy for Apple to provide: Select a photo, press Command-I, and in the info window, you could see a list of all albums containing the selected photo.

Unfortunately, Apple doesn't seem to think people might care about what albums a photo is in, so this feature exists only in my mind. Thankfully, Mac users Jacques Rious and léonie wrote an AppleScript to solve the problem. I used the first instance (version 4) of the script in that post and it worked fine in High Sierra. (In case Apple ever decides to remove its forums, I've recreated the script below.)

To use the script, paste it all into AppleScript Editor and save it as an application (or you can just run it in AppleScript Editor). In Photos, create a top-level album (I named mine Find Albums Photo Is In), and place the photo you want to know about into that album. Leave it selected, then run the AppleScript. You'll see one dialog stating what photo is being used, then after a bit, you should see a results dialog, like this:

As you can see, the album used for the search is included in the results; someone with better AppleScript skills than I could probably modify the script to exclude that album (any takers?). While I'd much prefer Apple include this feature directly in Photos, at least there's an alternative when you need this information.

[continue reading…]



How to download macOS Sierra

This morning on Twitter, Antonio asked…

I thought "Well, that's an easy question to answer—via the Mac App Store, of course." As it turns out, that's the right answer, but it was much harder to find than I expected it to be. I started on the Purchased tab in the Mac App Store app, where you can (theoretically) see all past purchases, including prior Mac OS X versions. However, those old releases stop with Mac OS X El Capitan from 2015; neither Sierra nor High Sierra are listed.

Next I tried searching the Mac App Store for Sierra, but that nets only Server and High Sierra, and a few apps that appear to have gotten away with using "Sierra" in their descriptions:

I then tried the Apple Developer site, but they don't offer Sierra for download either.

Somewhat stumped, I then started searching, and after way too many attempts, I finally landed on this useful page at Stack Exchange, which attempts to explain how to download all older versions of Mac OS X/macOS. Here's the relevant bit for Sierra:

For OS versions since Sierra.

Sierra itself has now vanished from everybody's Purchase History. However, Apple are keeping Sierra fully available, even though High Sierra is out. No Apple ID is required.

Apple KB - How to download macOS Sierra
Sierra - Direct download link from the App Store

Given how much trouble I had finding this page, I thought I'd post it here for anyone looking for Sierra. Going forward, keep that Stack Exchange link handy, as it should be updated in the future as new releases come out.



Easily delete albums in Photos

Last fall, I finally made the move from iPhoto to Photos…months later, I still find myself frustrated by many things in the Photos' user interface.

Today's aggravation dealt with cleaning up a bunch of older photo albums—some I just wanted to delete, others I wanted to convert from Smart Albums into normal albums (because I wouldn't be adding any more photos that used the keywords in the Smart Album). That meant I wanted to delete a bunch of albums—well over 100.

Deleting an album in Photos can only be done from either the My Albums overview, where you can select more than one (though not across folders), or via the contextual menu in the sidebar.

The My Albums view wasn't going to work for me, as I needed to look at and work with many of the albums, across many folders. But after the sixth time of doing the "right click, select Delete Album, tab to Delete in the confirmation dialog, press Return" dance, I was sick of it. Time for another Keyboard Maestro macro.

This one is very simple—it just replicates the actions required to delete an album. With it in place, I click on the album I wish to delete, then press Control-D. It's still more mouse interaction than I'd prefer—why can't I select albums via the keyboard?—but it's oh so much faster than using the contextual menu.

[continue reading…]