Create a keyboard-shortcut for Show Package Contents

Jul 25, '06 07:30:04AM

Contributed by: bfad

In case you're new to the Mac, let me give you a bit of a background. In the Mac OS X filing system, there are some special kinds of folders that are treated like files. These folders-treated-as-files are known as packages. A Pages document, for example, is actually a folder package. So are most applications.

At times, it can be advantageous to see the contents of these packages, and you can do that by control-clicking on the package and choosing 'Show Package Contents' from the pop-up menu, or by selecting the package and clicking on the Action button in the Finder's toolbar and selecting 'Show Package Contents.' Enter my dilemma. As a long-time Mac user, whenever I need to navigate through the filesystem, I usually use keyboard shortcuts such as starting to type the name of the file/folder I want to navigate to or through. However, there is no keyboard shortcut to reveal the contents of packages, and since the command is not found in the Finder's menu bar, I can't easily create one through System Preferences.

The solution: Automator and AppleScript with GUI Scripting.

Requirements:

  1. Apple Script GUI Scripting must be enabled. Open the AppleScript Utility, located in /Applications -> AppleScript. Make sure the 'Enable GUI Scripting' check box is checked.
  2. The Action button must be on the toolbar of your Finder windows. (It's the button that has the picture of a gear.) If it's not, open a Finder window and choose View -> Customize Toolbar from the Finder menu, and drag the "gear" button up to the toolbar from the resulting dialog sheet.
  3. This Automator application [macosxhints mirror] I created.
  4. A program that you can use to configure a keyboard shortcut to launch the application. Since Butler is one of my favorite programs, I used it to set up Control-Command-O as a trigger that only works in the Finder, and runs the Automator program.
A couple of notes. You should be able to use Automator to open up and view the actual workflow I created (just drag and drop it onto Automator). If you want to edit it and tweak it, feel free. If you do, you may notice it starts running in the Dock. See this hint to make it a faceless application again. Also, the first run will probably be slow, but successive runs should be run more quickly.

[robg adds: I use FolderGlance to drill into packages, but it's still not a hotkey-accessible solution. I tested the Automator app and it works as described.]

Comments (9)


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