10.6: Use Automator to ease document-app assignments

Sep 23, '09 07:30:08AM

Contributed by: robg

As has been covered in many spots, including my own high-level look at the issue, Snow Leopard changes the way files are associated with their creating applications.

In short, you can no longer expect (at least in the near term) that double-clicking a file created by BBEdit will actually open that file in BBEdit. Until all developers start using Uniform Type Identifiers (UTIs) (for more on UTIs, see this detailed article at AppleInsider), users may be surprised to find a BBEdit .html file opening in their default browser when double-clicked.

How can you avoid these problems in the short term? You can drag a document onto the creating app's icon in the Dock; use the Open menu from within the app, or use the Get Info dialog to change the associated application for the document. I've taken to using the third method, but wanted an easier way to get it done. Enter Automator and Services...

For each of the main applications I use (Smultron, BBEdit, and Photoshop), I created a very simple one-line Service in Automator to change the owning application for a selected file or files with a keyboard shortcut. To create your own, launch Automator and select Service from the template chooser that appears. Set the pop-up menus on the right to files or folders and Finder. In the Library column, select Files & Folders, then drag the Set Application for Files action into the work area on the right.

Click the Application pop-up menu, and select your application of choice. Now save your Service with a fitting name; Set app to PShop for instance. Repeat this process for each of your often-used apps, changing the pop-up and renaming each before saving. You've now got a set of shortcuts you can use in the Finder's contextual menu to change the owner of a document or documents.

To make these even easier to use, visit the Keyboard Shortcuts tab of the Keyboard System Preferences panel. Select Services in the leftmost column, and then look for your newly-added Services in the Files and Folders section of the rightmost column. Click in the blank area to the right of each one's name, and enter a keyboard shortcut. I had trouble getting shortcuts with just Control or Option to work, so I went with Command-Control, and these seem to work fine.

Now I can set the opening application for any file with a keyboard shortcut. One could, with a bit of work I think, modify the Service to display a pop-up menu of your most-used apps, instead of creating one Service for each app. I'll leave that as an exercise for you, though, as it's beyond my Automator abilities.

Comments (13)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20090923063518880