How to tame OS X's Launch Services
Create and edit file associations with ease
How many times a day do you double-click on files in order to open them and launch the application that created them? 10? 20? Maybe even 50?
It might even be more, depending on what you use your Mac for, your preferred way of working, and a whole load of other imponderables. However many times you or I do it, though, it's an action that becomes almost like breathing: we take it for granted it'll work, so much so that we almost don't notice we're doing it.
In fact, like most such instinctive actions, we only notice we're doing it when something goes wrong. You might, for instance, expect a particular application to launch when you double-click a file, only for another to take you by surprise by launching instead. Fortunately – at least when it comes to aberrant applications – there are ways to get things back on track.
When you double-click a file, Mac OS X's Launch Services kick into action, finding the preferred application for opening it based on, among other factors, its file type (JPEG image file, for instance) and filename extension (in this case, .jpg).
Incidentally, this applies even to .app files, which might have a flag, or marker, indicating that they need a particular version of Mac OS X; or even, in the case of an older application, the Classic environment (for those of you who still need it, that is). All this is stored in Mac OS X's Launch Services.
Open With
Sometimes, you might want to open a file in an application other than the default, in which case you can either open the application first and go to File > Open…, or right-click (or [Ctrl]-click) the file and choose Open With. If you do the latter, you'll see the default application at the top of the list (with the word 'default' next to it in parentheses), followed by a list of other applications you can use to open the file.
Get daily insight, inspiration and deals in your inbox
Sign up for breaking news, reviews, opinion, top tech deals, and more.
There might be other occasions when you need to change the default application for opening particular file types; if, for instance, you've just installed a new application such as Photoshop Elements, and want all JPEG images to open in the latter rather than Preview. In this case, single-click one of your JPEG files, go to File > Get Info… (or use the C+[I] keyboard shortcut) to bring up the file's Info box, then:
1) Click the disclosure triangle next to Open With
2) Choose your new default application from the pop-up menu
3) Click the Change All… button to make your chosen application the new default
4) Close the Info box
Finally, sometimes when you open up an Info box you might find the Open With pop-up festooned with multiple versions of applications (Preview, for instance), or even applications that are no longer installed. In this case, in order to restore some order to the list, not to mention your sanity, you can rebuild the Launch Services Database. To do this, launch Terminal (from Applications > Utilities), then type:
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/ Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user
before hitting the [Enter] key.
If you're not too chuffed at the possibility of using a shell script in Terminal, TinkerTool System (approx £6.50) will do the job for you.
-------------------------------------------------------------------------------------------------------
First published in MacFormat 203
Now read 20 ways to speed up your Mac
Sign up for the free weekly TechRadar newsletter
Get tech news delivered straight to your inbox. Register for the free TechRadar newsletter and stay on top of the week's biggest stories and product releases. Sign up at http://www.techradar.com/register