Skip to content

Apple Universe

Top-level category for all Apple, Mac, and OS X related topics.

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…]



A modest proposal to improve the iOS Settings app

One of the things about the iPhone I don't like is that Apple requires (recommends?1)Many apps now have settings within the app, which I love, so this "separate settings" thing doesn't seem to be a hard requirement. that apps keep their preferences (settings) in the Settings app.

While I understand the theory (don't clutter the app with prefs, all prefs in one spot), the reality is that this structure quickly turns the Settings screen into an endlessly scrolling nightmare. I hate opening the Settings screen, knowing how much flicking it'll take—simulation visible at right—to get to the app whose settings I want to modify.

With some apps having some of their prefs within the app, and some of their prefs on the Settings screen, I find I often have to look in both places to see if the pref I want is available.

What I'd love to see is Apple recommend (require?) that apps do not use the Settings screen, and instead keep their prefs within the app. After all, if you're using app XYZ and you want to change something about its settings, the most logical place to look would be within the app itself. This would greatly clean up the Settings screen, too, restricting it to just Apple's stock apps and system-wide settings.

But barring that change, I'd like to see a more-usable Settings screen. How can it be more usable? By splitting the apps into alpha buckets, so I could tap into a letter/number, and then see only those apps on the list. Something like this very-rough mockup…

A horizontal flick on the alpha row scrolls through the letters (and numbers), then vertical flicks scroll within the chosen letter. This index would appear with the first entry in the third-party apps section, then stick to the top as the user scrolled down.

I'm sure there are better ways to do this, but something needs to be done, especially as device storage sizes increase.



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…]



An aging corner of Apple’s web site

Sometimes, when I go looking for something on Apple's web site, I'll stumble into some dark corner that's somehow escaped the passage of time. Like the Mac Basics: Desktop page. I mean, just look at that desktop screenshot…

That's from Yosemite (Mac OS X 10.9) Mountain Lion (Mac OS X 10.8) , which was released in October of 2014 July of 2012 [Thanks Tim B!]. It's not even retina—the source image is 640px wide, which is why it's all fuzzy. And, of course, the Dock is no longer 3D and most of the app icons have changed.

Maybe they'll update that page when they fix that other aging corner of their site…you know, the one where they sell the 2013 Mac Pro as if it's brand-new technology.



The useful yet useless Services menu

One of the most-useful tools in macOS is also one of the most useless: The Services menu. In theory (and occasionally actually true), the Services menu lets you quickly take action on something—a selected file or folder, or a chunk of text. In reality, the Services menu is a vaste wasteland of unused functionality, and a place where pre-assigned keyboard shortcuts go to hide from your attempts to use them elsewhere.

If you install a fair number of apps on your Mac, you may be surprised by the amount of stuff in your Services menu. Here's a look at my iMac, after I reset the Services panel (System Preferences → Keyboard → Shortcuts → Services) to its defaults:

If you're good at counting, you spotted 123 separate services flowing past. Not all are active, of course—"only" 58 are. Of those 58, you'll see some subset based on whatever you've selected…but even that subset can present itself as a huge list:

That's really not very helpful when you want to quickly apply some action to your selection. To make the Services menu useful again—and to potentially free up some keyboard shortcuts—you'll need to actively manage your Services.

[continue reading…]



More about macOS Sierra and Library shortcut keys

Yesterday, I wrote about an apparent change in Finder's Library shortcut key. To wit, it used to be that holding the Option key down would reveal a Library entry in Finder's Go menu.

However, on my iMac and rMBP running macOS 10.12.3—and on others' Macs, as my report was based on similar findings by Michael Tsai and Kirk McElhearn—the Option key no longer worked; it was the Shift key. But on a third Mac here, running the 10.12.4 beta, the shortcut was back to the Option key.

To further add to the confusion, a comment on the original article—as well as replies to the others' tweets—states that the user's Mac is still using the Option key in 10.12.3. So I thought I'd create a new user account, and see if I could figure out what was going on.

After some experimentation, I was able to discover why the shortcut key changes, and how to change it between Shift and Option at any time. This clearly isn't a feature, so I guess it's a bug, but it's a weird bug.

[continue reading…]