Mac OS X

Mac OS X: Keyboard shortcuts to launch any application

The Spotlight feature in OS X can start any application from the keyboard, and you don’t even have to program it. But if you want to assign a specific keyboard shortcut to an application, that capability is not built into OS X so you’ll need to use additional software for that (see the comments at the bottom for a discussion).

And if you came here looking for an Activity Monitor keyboard shortcut (as my blog stats suggest), read all the way to the bottom to learn why you might not even need one.

(Update: If you really want to assign a keyboard shortcut to a file like you can in the Properties dialog in Windows, conroy in the Adobe User Forums suggests an OS X tip involving Automator and Services.)

The secret weapon is Spotlight

With Mac OS X 10.4 or later, you don’t need to create or even learn shortcuts for applications. They’re already there, but not in the form you may be expecting.

The key is Spotlight, the search utility built into OS X, which is a decent application launcher. Just hit the Spotlight keyboard shortcut (Command+spacebar unless you changed it), type the first few letters of the application’s name, and if the application’s name is the Top Hit, press Return to launch it. (In OS X 10.4, you need to press Command+Return; In 10.5, Apple simplified it to just Return.) If it isn’t the Top Hit, use the usual Spotlight shortcuts to get to it in the list: Use the up and down arrow keys either alone, or with the Command key to jump categories.

So for example, if I want to use Activity Monitor, I press Command+spacebar, then type “act” and boom, there it is. Depending on which files and applications are on your computer, Activity Monitor may appear before you get to the third letter.

If you’re annoyed because you have to type a few letters before Spotlight narrows it down to the application you want to launch, have patience. If you keep picking the same item from the search results, OS X will eventually turn it into the Top Hit, and over time you’ll need to type fewer and fewer characters to get your preferred result. (You can accelerate searching for multiple words through abbreviation; read about it here.)

By now I’ve got my Mac trained so that after pressing the Spotlight shortcut, Photoshop becomes the Top Hit as soon as I type “p”, and Mail is selected as soon as I type just “m”. Yeah, it’s more than a single keystroke, but on the other hand, to get this feature I didn’t have to modify my system, spend an hour configuring shortcuts, or add a utility such as LaunchBar. Spotlight is already capable of launching any application on your system without any further setup.

Spotlight launching Photoshop by typing one letter

There’s a second benefit to leaning on Spotlight for this purpose: You never have to dig down to open an application or utility that isn’t already in the Dock. You don’t even need to know where it is on your hard drive! Using Spotlight as an application launcher can also let you reduce the number of application alias icons littering your desktop or Dock. Since I usually launch via the keyboard, I actually have my Dock hidden by default.

I took it one step further and used the Keyboard Shortcuts customizer in the Keyboard system preference to change the Spotlight shortcut to F12 on my notebook and F13 on my desktop so that I could get to Spotlight by pressing just one key.

Before OS X 10.4 brought us Spotlight, I used to be a devotee of LaunchBar, and I tried Quicksilver. The problem is that even if a launcher app is free, the second indexing engine drags on the system and adds complexity, another database to store and manage, and removes another set of keyboard shortcuts from the pool. When Spotlight came out, I realized that it does most of what I need, and well enough. The things Spotlight can’t do that the other utilities can do I’ve mostly covered by having Spotlight trigger AppleScripts…but that’s a subject for another entry.

You don’t really need to launch Activity Monitor

Update: There are so many Web searches that come here looking for an Activity Monitor shortcut that I have to add this: If you frequently want to monitor Mac system status information, you should download iStat Menus (used to be free, I decided to pay) atMonitor, or MenuMeters (those last two are both free). They put all of that CPU, RAM, drive, network, etc. information right up there in your menu bar. Ultimately, iStat Menus is why I don’t need to open Activity Monitor, because what I want to see is already visible or accessible in one click, and without blocking what I’m working on.

In the picture above, you can see part of my iStat Menus setup in the menu bar: current network throughput, hard drive activity and free space, RAM usage, and multi-core CPU meter. Clicking any of those items drops a menu with much more detailed information.

Microsoft Office 2004 for Mac: Free a stuck Help window

The Microsoft Office Help window’s title bar can sometimes get stuck under the menu bar. When that happens, you can’t move the Help window, and you can’t close it because the close button is part of the title bar. Because the Help window is more like a palette than a window, it doesn’t respond to any Close Window keyboard shortcut or the arrangement commands under the Window menu, and it floats above all other windows. It basically blocks your document window until you restart the application.

Short answer

Throw out the file com.microsoft.Office.prefs.plist, or if you want to be more precise, instead of throwing out that file, open it and increase the value for Help/Help_Top so that it clears the menu bar.

Long answer

Or, how I figured this out:

The usual suggestion for a problem like this is to delete an application’s Preferences file. I didn’t want to throw out the Preferences file because I’ve heavily customized my Office installation (toolbars, etc.) and I didn’t want to reconfigure everything from scratch. Mostly because I can’t even remember everything I’ve customized and now rely on (can you?). I suspected that there must be a setting in a preferences file somewhere that controls the position of the Help window, and if I could change that one thing I wouldn’t have to throw out the baby with the bathwater. And so I went looking for that setting.

First I tried AppleScript. I used the Script Editor to open the AppleScript dictionary for Excel, where I was having the problem, but I couldn’t find any commands that controlled the Help window.

I then started looking in the Preferences folder, in my Home/Library folder. You can read these files in TextEdit, but it’s nicer to use the free utility Pref Setter, which lets you view and edit the contents of a preferences file in a clean, easy, point-and-click way. I guess you could also use your favorite XML utility.

Now to find that window preference:

I looked in the file com.microsoft.excel.plist, but found nothing that looked right. While many Microsoft and Adobe applications have a preference (.plist) file at the top level of the Preferences folder, it turns out that these usually contain only information for the Open and Save dialog boxes. The real preferences files are usually buried deeper. But how was I going to find it? I typed “excel” into the Find field in Pref Setter’s Open Domain Quickly window, and it revealed a list of files inside the Preferences folder with Excel in the title.

Unfortunately, I still didn’t find what I was looking for. I thought to myself, maybe it isn’t specific to Excel…if it’s about the Help file, could it be an Office-wide preference? To test that, I typed “microsoft” into Pref Setter’s Find field and it turned up many more files, including some in a Microsoft sub-folder.

I opened com.microsoft.Office.prefs.plist. It’s a long list of preferences, and I wasn’t sure I could find the one I wanted. But there’s a Find field in the com.microsoft.Office.prefs.plist window, so I typed “help” into it to try and narrow down the list.

Aha! That revealed several preference settings:
Assistant\AsstWithHelp
Help\Help_Bottom
Help\Help_Left
Help\Help_LeftPaneWidth
Help\Help_Right
Help\Help_Top
Help\Help_ZoomedOut

Bingo.

Help\Help_Top was set to 22. I was pretty sure that was a vertical offset from the top of the screen, and guessed that if I set that to a much higher number, the window would move down. I changed the number to 100, saved the document, started Excel, and opened Excel Help.

Fixed!!!

I hope this serves as an example of how to locate application preference settings with the help of a utility like Pref Setter.

Stuttering video playback on PowerBooks and iBooks

If you experience stuttering, jerky video playback on an Apple PowerBook or iBook, here are some ideas.

Check Energy Saver settings. Open your System Preferences and click Energy Saver. In Energy Saver, click the Options tab. Now check the setting for Processor Performance. If it’s set to Reduced, change it to Highest or Automatic. Video playback may be smooth now.

If you’re running on battery, be sure to change the Processor Performance setting back to Automatic or Reduced when you’re done watching video. The Highest setting drains the battery the fastest. Note that on a notebook, the Energy Saver preference lets you save different settings for Battery and Power Adapter.

You might see the effect of the Reduced setting any time you perform processor-intensive tasks such as audio or video rendering, or gameplay. In those situations, you’ll want to set Processor Performance to Automatic or Highest.

Note: The Energy Saver tip won’t work with MacBooks and MacBook Pros, because Intel CPUs automatically try to balance smooth playback against battery drain. The older PowerPC CPUs were not as smart.

Check for other processor hogs. If you set Processor Performance to Highest and you still see choppy performance, the cause may be another application that’s using processor cycles. Open your Activity Monitor utility, view the CPU tab, show all processes, and sort the list by %CPU to see if any applications are using an unusually high percentage of CPU cycles. While new computers can handle today’s streaming video easily, the same video demands almost all the CPU power available in older computers, so any unnecessary tasks can interrupt smooth video playback.

Watch out for HD video. If you have a PowerBook or iBook, you’ll probably have to avoid HD and choose the SD (standard definition) option when you watch Internet video. Smooth HD streaming works best with a recent Intel multi-core CPU. When PowerBooks and iBooks were made, Internet video was much lower quality and there was no high-definition streaming. As CPUs got faster, what made high-quality HD streaming possible were new codecs that made up for limited Internet bandwidth by leaning on the CPU in your computer to process the highly compressed stream. Newer Intel CPUs are optimized for those codecs, so they can decompress video files and Web streaming video very quickly without slowing down the whole computer.

But the G3 and G4 CPUs in PowerBooks and iBooks do not have those Intel optimizations (PowerPC G3 and G4 CPUs were not made by Intel), so they are are too old and slow to decode HD without stuttering. A PowerBook G4 might have a CPU running at 1GHz, while a MacBook Pro has multiple multimedia-optimized CPU cores running at over 2GHz each. Even an old, used MacBook Pro has many times the processing power of a PowerBook G3 or G4.

Also, check the speed of your connection to the Internet. You need a fast enough connection to stream HD smoothly. My old Internet connection was too slow for HD streaming, forcing me to watch SD streaming even on my newest Mac, or let HD video buffer longer before I play it back. My current Internet connection is capable of carrying HD video data fast enough for smooth playback on a computer that’s fast enough to decode it.

Mysterious application failures caused by delocalization

OS X supports a large number of world languages, but if you only understand one language, you’re hauling around many megabytes of files you don’t need. Many Mac users try to free up some disk space by using a utility that removes versions of files for languages they don’t want. This has given rise to a class of utilities that hunt down and delete all the files for specified languages. Some of these utilities are:
Delocalizer [Note: This software appears to be discontinued. (June 2011) ]
Macaroni
Monolingual
Youpi Optimizer  [Note: This link is now dead. (June 2011) ]

Nearly all of my applications run fine after delocalization, but there are a few that don’t like to have their localized resources deleted, and they refuse to run without them. These applications might not display a specific error message for this, so all you see is a general error message that leaves you guessing.

The applications that I know about that don’t like to be delocalized are:
Adobe Illustrator CS2 (the 12.0.1 updater fails to install the update)
Adobe Acrobat 7 (Macaroni users update to Macaroni 2.0.6 or later)
Adobe Acrobat 8 (application will not launch, says “A required component was not found.”)

(NOTE: Macaroni 2.0.8 is now available, and according to its release notes, it will no longer delocalize any Adobe applications. This should prevent future Macaroni delocalization problems with Adobe apps.)

If you run a delocalizer and those applications or their updaters stop working, you must reinstall the application. Then you have a choice: Either see if your delocalizer utility has a way to exclude specific applications (a whitelist), or don’t delocalize again. Read on for why that second option might be realistic.

Nobody likes to have something not work, especially if it’s just one pesky app that breaks after delocalization when all the other apps are fine. And delocalization can benefit users with small hard disks. But you may not need to delocalize if you have an up-to-date computer. Today’s hard drives, now typically 250GB and up even on notebooks, are so large that a hundred or so megabytes of localized files are unlikely to be the major cause of a full hard drive. If your Mac hard drive is filling up, you’ll probably get a lot further by moving unneeded movies, photos, and music to another drive. One hour of miniDV format video from is around 13GB, many times larger than all your localized files. Also, the digital audio and graphics samples that come with multimedia applications such as GarageBand, Apple Soundtrack, and Apple LiveType take up several gigabytes on their own, so you might want to clean house there unless you need those samples.

Why would an application fail after delocalization? In many cases an application will use a checksum to verify its integrity. It knows what its file size was when originally installed, and if it notices that there’s a discrepancy the next time it launches (because you removed stuff), it won’t run. It does this because a size discrepancy can indicate that the application code has become corrupted or that malware has infected and modified the application for its own nefarious purposes. Those are some of the reasons why an application may be built to be extremely suspicious when its size changes, to the point of shutting itself down. The developer wants to make sure that the application won’t do any damage to your files.

Back up important preferences files

When an application isn’t quite working right, sometimes the cause is a preferences file that’s gotten corrupted, so a common troubleshooting step is to delete an application’s preferences file. That’s easy to do, but with many of today’s more complex software programs, preferences are key to your workflow, and when you lose your preferences, the program may no longer do what you expect it to because it’s reverted to the factory defaults. If you’re trying to get jobs out fast, reset preferences can slow you down until you get all of them back to the way they were.

Let’s take Photoshop, for example. The preferences control everything from how keyboard shortcuts work to which disks are used for scratch files. If you’ve changed 24 preference settings and then one day you have to delete the preferences file to solve a problem, it’s hard to remember all of the options you changed. Keyboard shortcuts, units of measure, tool defaults, printer profile choices, and scratch disk locations can all be changed to settings you aren’t used to.

Here’s an easy way to restore your preferences easily in case you have to delete your preferences. After you get preferences set up the way you want, and before a problem happens, just create a .zip archive of your preferences. Whether you use Mac OS X or Windows this is easy and just takes a second.

First, find the preferences file you want to preserve.
Then, on Mac OS X, select the file and choose File > Create Archive Of (the filename).
On Windows, right-click the file and choose Send to > Compressed (Zipped) Folder.

You can just leave the zip archive next to the original preferences file because the program that uses that file will ignore it if it has the .zip filename extension instead of its normal one. Because the zip archive is created in the same location with a nearly identical filename, you don’t have to fish it out of a backup somewhere; it’s already in the right place.

When you have a problem that requires deleting preferences, delete the actual preferences file and then simply extract the backup preferences from the zip archive by double-clicking it. On Mac OS X, the file appears in the same place you zipped it, which should already be the right place if you zipped it in its proper folder location. On Windows, you may have to go through the extra step of dragging it out of the containing folder that the Extraction Wizard creates and then deleting that extraction folder. On either OS, the zip archive remains in place so you can easily extract the backup again in case you have another problem in the future.

Some applications have entire folders of preferences, or additional folders in the Application Support folder on Mac OS X or the Common Files folder in Windows. If those folders contain presets or other files that can’t be reinstalled from the original disks because they’re unique to you, it can be a good idea to back those up in place too.