Skip to content

macOS Apps

Articles about OS X applications.

How I organize my Keyboard Maestro macros

This post was originally published in Decwember of 2016. I took it down to replace one section (using repeats) with another (using groups), and to expand some other areas.

I've been using Keyboard Maestro (or KM for short) a lot lately, i.e. Create an iTunes song info window or A much improved special character palette, or a slew of others.

As my collection of macros has grown, and some of those macros have gotten more complex, I've been using a few of KM's features to help keep my macros organized, and make it easier to debug them while I'm working on them. Some of these are obvious, some maybe not so obvious, so I thought I'd share what I'm doing.

[continue reading…]



Capturing macOS screenshots and onscreen objects

I capture a lot of screenshots—both for this blog, and for our Many Tricks' help files and web pages. Depending on the project, I may need a full screen, a portion of a screen, a window, an object, or some combination of the above. As such, I use a few different ways of capturing screenshots.

First up are the built-in macOS screenshot tools, which you'll find on the Keyboard System Preferences panel, in the Shortcuts tab:

These four commands let you capture full screens or windows, directly to files or to the clipboard. And, for many users, these may be all you need. If that's you, great! (You may want to assign some easier-to-type shortcuts, as these—especially the clipboard variants—require some advanced finger gymnastics.)

I use some of these built-in tools, along with a key third-party app, to handle all my image capture needs.

[continue reading…]



Change the look of inactive Terminal windows

I tweeted this recently…

Things I did not know (or perhaps remember): Terminal lets you set the opacity and blur of inactive windows. (Profiles > Text > Background)

…but because I often forget about those things—the ephemeral nature of tweets being what it is—I figured I should post it here, too.

I have no idea when the feature appeared, but I only discovered it on February 27th, when I tweeted about it. You'll find the window at right in Terminal's preferences, on the Profiles tab—look in the Text section for a selected window, then click the color tile under Background. Check the box to set opacity and blur for inactive windows, and you're done.

As I use a dark background in Terminal, I like this feature a lot. I've now got it set up to go transparent and fuzzy when inactive—this makes it basically vanish, so the dark background no longer grabs my eye.

At some point, I'll dig through my virtual machines and figure out when this was added…who knows, maybe it's been there for forever. In any event, I'm glad I stumbled across it the other day.



Prevent BBEdit from importing ‘find’ strings

I use Bare Bones' BBEdit for most of my text editing, but there's one thing it does that drives me crazy: It will replace your "find" search terms with something you've used elsewhere. It goes like this…

  1. Set up a complex find/replace that you need to do a number of times in BBEdit.
  2. Do some finding and replacing, then switch over to another app to do some other stuff, including copying and searching.
  3. Switch back to BBEdit, open the Find dialog…and discover that the Find box now contains the text you used for searching in the other app.

Argh! Thankfully BBEdit saves previous queries, so it's a click to get it back. But I finally got mad enough to search for a better solution, and found it on a previously unknown to me expert preferences page on Bare Bones' site.

There's lots of good stuff on that page, but this section is the one of interest for the "Find" problem:

Like many Mac OS X applications, BBEdit supports the “Find Scrap”, a feature of the OS that enables sharing of the “search for” string between applications. Some applications put inappropriate content (such as Web search strings) on the Find Scrap, which can cause the “search for” string in BBEdit’s Find dialog to be replaced when you didn’t expect it.

Bingo! Quit BBEdit, open Terminal, paste this line, hit Return, and relaunch BBEdit:

defaults write com.barebones.bbedit FindDialog_UsesFindScrap -bool NO

No longer will your expertly-constructed Find string be replaced by interlopers from the outside world.



Fix Messages’ broken bundled AppleScripts

While playing around with Messages this morning, I noticed that it ships with a feature that, if used, throws an error. Steps to reproduce:

  1. Open Messages' preferences.

  2. Set the Applescript handler pop-up to any of the listed scripts:

  3. Close preferences, and try to send a message to anyone.

  4. Revel in the brokenness.

I especially like the execution error: No error message…it's that rare non-error that tosses up an error dialog!

In any event, I think it's shameful that Apple ships the app with a feature—plainly obvious in prefs—that breaks when used. Yes, I know AppleScript is probably dying, but that doesn't excuse shipping the app with a clearly-broken feature; if it doesn't work, just remove it. Apparently this has been an issue since Yosemite's release in October of 2014!

With all that said, fixing this is incredibly easy—it took me about 30 seconds of "work" to find and fix the problem. If you'd like to use the bundled AppleScripts in Messages—either as is, or in some modified form—here's what you need to do

[continue reading…]



Count characters in Keyboard Maestro inputs via filters

Yesterday, I added an SSL certificate to my site, and posted a brief note about the change. In that post, I included an image…which turned out to be, well, the comments say it all:

Yes, I posted a non-https image in the 'site is secure' post. Sigh.

So I took Jonathan's comment to heart, and created a Keyboard Maestro macro that ensures I post only relative URLs from now on.

Generally, I don't think such a thing would be worth sharing, as it's just a basic text replacement macro, right?. Mostly right, but in this case, I learned about a Keyboard Maestro feature that may be useful to others. So share I will…

[continue reading…]



Magically achieve ‘inbox zero’ in Mail…or don’t

While working yesterday, I noticed that my inbox was empty. Generally, I strive to keep it that way, but I knew it wasn't true just then—my phone showed six messages in my inbox. Even stranger, using a Smart Mailbox in Mail, set to "show messages in inbox for Many Tricks," revealed the six messages. It was only when clicking into the mailbox itself that I couldn't see anything. At first, I blamed Mail…

Can you blame me, though, after my Mail search issues and the weird potential fix?

When I looked a bit closer, I spotted a clue that maybe it wasn't all Mail's fault. The "(0 filtered messages)" as seen in my tweet normally reads "(0 messages)." This was different, so I went looking in Mail's menus for "filter," where I discovered View > Disable Message Filter. Because the menu read "Disable," that meant the feature was enabled. I selected it, the menu switched to Enable Message Filter, and bingo, my inbox messages were back!

So what happened, and why wasn't it more obvious to me what had happened? The fault lies both with me and with Mail.

[Note: Glenn F wrote about this very issue for Macworld a few months back…sorry I missed it, as it would've saved some investigative work on my end!]

[continue reading…]



Open Unix man pages in their own Terminal window

A while back, I wrote about opening Unix man pages in Preview, and this is still my preferred method of browsing man pages. However, there may be times where Preview is overkill, and you want to stay in Terminal, maybe for a short help file such as that for ln. But opening a new window by hand is a bit of a pain, and tabs won't work because you can't see both the window and the man page at the same time.

While browsing the old Mac OS X Hints site, I found this nice solution: Open man pages in a new Terminal window, one that's set up just for reading such pages. It looks something like this (though I've customized my setup; keep reading)…

Adding a few lines to your shell's startup file makes opening these 'in their own window' man pages as easy as opening 'regular' man pages.

[continue reading…]



The little I know about regex…and where to learn more

First off, regex is shorthand for a regular expression. And what, exactly, is a regular expression? According to the linked Wikipedia page, a regular expression is…

…in theoretical computer science and formal language theory, a sequence of characters that define a search pattern. Usually this pattern is then used by string searching algorithms for "find" or "find and replace" operations on strings.

That's a mouthful, but what it means is that you can write some really bizarre looking code that will transform text from one form to another form. And if you know just a bit of regex, and where to go to look up what you don't know, then you can use regex to do many useful things.

For example, consider this filename on a scanned-to-PDF receipt:

The Party Place [party supplies] - 02-06-2017

Perhaps you'd prefer it if the date came first, in year-month-day order, so that your receipts were ordered by date, like this:

2017-02-06 - The Party Place [party supplies]

Sure, you could manually rename this one file, but what if you have 500 receipts that you need to rename? Enter regular expressions—they'll let you do this text manipulation, and many more. What follows is a very brief summary of my knowledge of regex, along with pointers to sites where I go when (very often) the problem I need to solve is beyond my regex skill level.

[continue reading…]



Disable local Time Machine backups on laptops

Just noticed this post over on iMore…did you know that Time Machine automatically creates local backups on your laptop Mac? As described by iMore…

On Apple laptops, like the MacBook, MacBook Air, and MacBook Pro, Time Machine includes the added feature of creating local snapshots so that, if you disconnect your MacBook from its external hard drive, you'll still have backups stored on your internal hard drive so you can recover data if you need to.

While the iMore article points out how to disable/enable the feature (sudo tmutil disablelocal or …enablelocal in Terminal), here's a bit more detail not provided in the article.

First, this is not some hidden hack; you're merely changing a setting using an Apple-provided command line interface to Time Machine. Apple, for whatever reason, chose not to include this setting in the GUI, but you're not risking anything by making this change.

Second, you'll find the local backups in a root-only folder named .MobileBackups, at the top level of your hard drive. You can—sort of—see how much space they take up by selecting About this Mac from the Apple menu, then clicking on the Storage tab. On my MacBook Air, which has a 2GB local backup, I see 4GB of purgeable space, which I assume includes that backup.

To get the actual size of the local backup, run this command in Terminal:

sudo du -h /.MobileBackups/

Provide your password, then wait a bit. The last line of the output will be the total size of the folder, stated in gigabytes…

…
…
 23M	/.MobileBackups//Computer/2017-02-16-092144
2.0G	/.MobileBackups//Computer
2.0G	/.MobileBackups/

And finally, if you disable this command, how do you know you've done so, months from now when you've forgotten about this? Time Machine itself will tell you, on its System Preferences panel. (Sorry for the low-res shot; I only have local backups enabled on my 11" Air!)

As seen, after disabling the setting, Time Machine's System Preferences panel will no longer list local backups as one of the tasks it performs.