Skip to content

Mac OS X Hints

On the increasing difficulty of launching some apps

A brief history of launching Mac OS X/macOS apps…

Mac OS X 10.7 and earlier: Launch whatever app you want, the OS doesn't care.

Mac OS X 10.7.5: Gatekeeper appears, but is a benign master, defaulting to allowing apps from anywhere. You can still install and run anything without any intervention from the OS.

Mac OS X 10.8 through 10.11: The benign master is slightly less benign, as the default setting changed (somewhere in that timeframe) to only allowing apps from the Mac App Store and registered developers. You could still disable Gatekeeper completely, though, as the "Anywhere" button was still present. If you didn't do that and tried to launch an app from outside the store or a non-registered developer, you had to click OK in one dialog box. Still not awful, but you were aware you were working outside the Gatekeeper's happy zone.

macOS Sierra (10.12): The benign master is now clearly just the master—the "Anywhere" button is gone. (Gatekeeper can still be disabled in Terminal, if you wish: sudo spctl --master-disable.)

And when you try to run an app from an unidentified developer, you really have to jump through some hoops…

[continue reading…]



Color and ‘human readable’ file sizes in Terminal

These are two very old tips, but I'd forgotten about them until recently, when I sent someone a screenshot and they said "Hey, how'd you do that?"

Do what, exactly? This…

The most-obvious thing in that shot is the colored filenames. But notice, too, the file sizes are in a human-readable form. Both of these changes are pretty simple, though you could spend hours playing with colors.

Human-readable output

To get human readable output—not just from ls but also in du, which shows disk space usage—just include an h with the ls command: ls -alh. Instead of raw bytes, the values are converted and marked with trailing B, K, M, etc.

Because I never use ls in its short form, I actually added a line to my .profile (which loads whenever you open a Terminal session) to make this automatic:

alias ls='ls -alh'

You could do the same thing with du, but I rarely use that command, so I didn't bother.

[continue reading…]



Browsers, caches and web page changes

Browsers cache data whenever you load a page. In general, this is a good thing—you'll save data transfer (very important on mobile), and increase speed on any connection if the browser can use data that it's already cached.

But there's one place I hate browser cache: When creating or editing web pages. I'll edit a file, save the changes, upload the new file, load the page…and nothing. So I edit again, repeat, still nothing. Only then do I remember the cache. Argh!

Thankfully, there are ways around (most) cache issues. I do most of my web development in Chrome and Safari; here are the simple tips I use to manage cache in those browsers when developing.

Safari

  • Enable the Developer menu (Prefs > Advanced > Show Develop menu in menu bar).

  • Once enabled, use the Developer menu to easily empty the cache via the Empty Caches menu item, which is bound to the keyboard via ⌘⌥E.

  • Also in the Developer menu, you can completely disable the cache with the Disable Caches menu item. This is what I do when developing—just remember to enable them again when you're done, or you'll find browsing quite slow.

  • To force a single page to completely reload, hold down the Option key and click on the reload icon in the URL bar.

[continue reading…]



Zoom zoom zoom

Today's tip is simple, yet for me, critical—it's one of the first things I do when I set up a new Mac or user on an existing Mac, as it solves a vexing issue: Small fonts that can't be modified within an app's preferences. As my eyes get older, these small fonts get more and more annoying.

Thankfully, there's a fix in the Accessibility section of System Preferences, specifically on the Zoom tab: Easily zoom the screen via keyboard or gesture shortcut. Here's the setup screen:

You can choose to use keyboard shortcuts to zoom (top section of the full screenshot), or (my preference) a scroll gesture with a modifier key. There are also some useful options in the "Zoom style" section.

[continue reading…]



Microsoft’s public-by-default file sharing site

This morning on Twitter, I saw that @rosyna had retweeted this tweet from @GossiTheDog:

https://twitter.com/gossithedog/status/845446263244050434

That seemed insanely scary, so I did a quick search on docs.com for password 1I am not revealing anything secret here; the original tweet went to thousands of people, and many have already noted the number of shared password files.. The results were quite shocking—hundreds of files containing full login information to major sites—Apple, AT&T, Facebook, Gmail, Linkedin, Netflix, PayPal, Twitter, etc.

It seems crazy to think that these users are intentionally sharing this information with the world. I wanted to see how it was happening, so I logged into docs.com with my Office365 account to see. I created a simple file to upload as a test. After uploading, you have to set a bunch of options before you save the file; one of the settings is the Visibility, and this is the default setting:

Yes, docs.com defaults any uploaded file to world-visible, "giving it a larger audience." Yikes!

[continue reading…]



Use macOS VMs in VMware Fusion in retina mode

I use VMware Fusion often—I have virtual machines that span Mac OS X 10.6 to macOS 10.12.4 beta. I use the more-recent of these for supporting our customers on older versions of the OS, and keep the really old versions just for nostalgia purposes. (I have a bunch of non-macOS virtual machines, too, but they're not relevant to this tidbit.)

In all the time I've been using Fusion on my retina Macs, though, I've never enabled this setting…

…well, I enabled it once, but turned it off, because the end result was too small to see: In Retina mode, every pixel is an actual pixel, not a doubled pixel. On my 27" iMac, that meant the macOS VM thought it was running at (for example) 2560x1600 instead of a retina resolution of 1280x800. VMware even warns you of this in their Knowledge Base:

Mac OS X running in a virtual machine is limited to an approximate resolution of 2560 x 1600, and treats the display as a standard DPI device. This makes the text and icons to appear small in the OS X interface.

However, today I stumbled across this solution from Patrick Bougie—and it's brilliant in its simplicity. Patrick's post has all the details; I'll reproduce them here in abbreviated form, just in case his page ever vanishes.

[continue reading…]



Edit long Terminal commands in a visual editor

Here's a quickie tip for those of us who occasionally string together complex commands at Terminal's prompt: You may want to add this simple line to your .profile (or whatever init file you use):

set -o vi

What does it do? It tells Unix/Terminal to set the input line editor to vi. When might this be useful? Let's say you've typed a long command, like the one to launch a background screen saver:

/System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine -module "Arabesque" -background &

Before you hit Return, you notice a couple of typos early in the command. You could use cursor movement keys to move around, of course, but with the above command in place, just press Escape and hit v: The entered command will open for editing in vi. Make your changes, then do the usual :wq vi exit dance, and your edited command will then execute.

Note that if you edit a command but then don't save it (i.e. you press :q!, you may have to hit Return on the command line to get out of an odd "waiting for v to edit" mode. (At least that's the only way I found to return to normal typing.)



An odd fix for ‘jpeg’ vs ‘jpg’ filename extensions

I recently reinstalled macOS Sierra, due to my annoying Bluetooth issues. I hadn't noticed any side effects of the reinstall until I went to save a JPEG image from Acorn.

On save, I noticed that the image's extension was .jpeg rather than what I thought was the usual .jpg. As both of my other Macs save with the .jpg extension, I figured something was messed up on the iMac. So I (of course) tweeted about the issue. A while later, Shawn King replied with this seemingly odd suggestion:

So I tried it, and sure enough, changing the screen capture file format via defaults write com.apple.screencapture type jpg and then restarting the SystemUIServer with killall SystemUIServer changed my default JPEG extension in every app to .jpg.

What's really strange is that I then switched the screenshot format back to png, and the .jpg extension remained. I even went so far as to delete the pref (defaults delete com.apple.screencapture), and still, the extension remains .jpg. So whatever change occurred when switching the default screenshot format, it appears to be permanent.

I tried the same trick for the .tiff extension (which I rarely use, so it doesn't bother me as much), and it sort of worked: Captured screenshots got a .tif extension, but images saved from apps still got the four-letter .tiff extension. Weird.

If anyone knows exactly what's going on with the .jpeg vs. .jpg extension, I'd love to hear the explanation.



Watch a screen saver in the background

Another oldie but goodie, and it's best demonstrated by example:

Yes, that's a screen saver running in the background, behind whatever work you're doing. And if nothing else, it's a great example of the progress of our CPUs and GPUs since 2002. In the original hint, I noted:

On my G4/733 with the GeForce3, this is simply amazing. The new "flurry" screensaver is running right now on the destop at 1600x1200 in thousands, iTunes is playing, the ink recognition floater is open, and yet the CPU utilization is averaging at or below 50% of thereabouts

Today, I'm testing it on a 5K iMac (5120x2880) with a second connected 4K (3840x2160) display—a total of 23,040,000 pixels, or 12 times as many pixels as in 2002—with Flurry running on both screens, and the CPU usage is somewhere around 10% to 15%. (Flurry does send the iMac's fans into a tizzy, though.) Other screen savers are even less intensive, and don't send my iMac's fans into high gear.

I can't imagine actually working this way for very long, but it is kind of interesting. Here's how to start (and more importantly, perhaps, stop) a background screen saver.

[continue reading…]



Open URLs in either frontmost or default browser

Between Many Tricks and this blog, I spend a lot of time in browsers. Most of the time, I use Safari, but I do occasionally work in Chrome and Firefox, too—most often to check how a page looks or functions.

I keep my "permanent" bookmarks in Safari, and don't presently use any sort of cross-browser sync. (I used to use one, but had a lot of trouble with duplicates, so I stopped.)

I wanted a way to open a limited number of URLs in either Safari (if that's what I was in, or if I wasn't in a browser), or in the frontmost browser, if that browser were frontmost. I could just create the subset as bookmarks in each browser, but if I wanted to add or remove a page from the list, I'd have to do so multiple times.

In the end, I came up with a set of Keyboard Maestro macros that do exactly what I want. I access my short list of multi-browser URLs via Keyboard Maestro's pop-up palette, as seen at right.

This appears when I press ⌃1; after that, a single digit opens the desired URL. But how does it know whether to open the URL in Safari or one of the other browsers? It takes one helper macro, then one macro for each URL that I want to open in this manner.

[continue reading…]