Open and Save Like a Pro: Secrets of Open/Save Dialogs

Post to Twitter

Open/Save dialogs are a core part of OS X. Like the OS itself, these ubiquitous dialogs have several layers of functionality: they’re easy to use and can be as simple as you like, but they’re also surprisingly complex and flexible beneath the surface. Today I’m going to share my collection of ‘little things below the surface’ in open/save dialogs.

Let’s start at the top and work our way down.

Use your Finder skills

As anyone can see, open/save dialogs are very similar to Finder windows. The standard sidebar, view modes, and grouping options are available. Don’t feel limited to using the default Icon View in open/save dialogs just because they’re small. Open/save dialogs are resizable, so don’t be afraid to use whatever view mode you in the Finder. Personally, I’m a big fan of Column View. The new Item Arrangement features are especially powerful in open/save dialogs since the file or folder you’re looking for is frequently one you’ve used recently. I set my open/save dialogs to group by Date Modified, which is a lot more efficient than digging through alphabetical lists.

Like in Finder, files and folders can be navigated using the keyboard. In Column and List views, use the arrow keys to navigate across and between files and folders. In Icon view, use the arrow keys to select a file or folder and cmd+/ to enter/exit folders.

Also like in Finder, there are keyboard shortcuts to jump to common locations:

  • ++O goes to your Documents folder,
  • +D goes to your Desktop,
  • ++L goes to your Downloads,
  • ++H goes to your Home folder,
  • ++C goes to the Computer,
  • ++K goes to the Network,
  • ++A goes to the Applications folder, and
  • ++U goes to the Utilities folder.
New folders can be created using the standard shortcut, ++N. Open/save dialogs have a special shortcut that isn’t available in the Finder (but it should be): the display of hidden files and folders can be toggled by pressing ++..

And, like most dialogs, you can press enter or either +O or +S to accept your selection and dismiss the dialog. Hit escape to cancel and dismiss the dialog without performing any action.

Type your paths directly

Let’s move on to a more advanced feature: the Go to Folder dialog. Like in Finder, you can access a prompt for typing a path by pressing ++G. If you love the keyboard, you’ll love this dialog; frequently, the fastest way to get to where you want to go is by typing its path. This is especially true because the Go to Folder dialog features tab autocompletion: type the beginning of the name of a file or folder and hit tab to fill in the rest of the name automatically. My favorite part about the Go to Folder dialog is that it appears automatically whenever you begin typing a path (/ or ~). When saving, the desired filename can even be included in the path.

Create shortcuts for commonly used folders

The Go to Folder dialog enables full keyboard control of open/save dialogs, and that means TextExpander. Any power users who don’t have TextExpander are seriously missing out. If any of this article has been interesting to you, I highly recommend that you install the trial and spend a few days playing around. TextExpander is available from Smile Software for $35, and is well worth it.

Now that you all have TextExpander, let’s put it to use. Open/save dialogs have some built-in navigation shortcuts for jumping to common folders, but everyone has other folders that they open from and save to frequently. With TextExpander, you can configure snippets that take you straight to a folder with one keyword.

Click the TextExpander menu bar item and choose Open TextExpander. Click the New Group button and create a new group called Paths. Make sure to set Expand after: to Whitespace. Now let’s create some path macros.
There are a few rules to making these. First, make sure they start with a ~ or a / so that the Go to Folder dialog is opened when you start typing. The slash is easier to type, so I usually go with that. The other rule is to end with pressing the enter key so that the Go to Folder dialog is dismissed. Let’s make a snippet.

Select your group and press the New Snippet button. In the Abbreviation field, type the keyword that you want to use (remember to start it with a ~ or /). Make sure the Content field is set to use plain text, and then type in your path. At the end, press the I button at the bottom left of the snippet pane. Choose Key -> Enter. Ta-da, your first path snippet. Go to an open/save dialog and try it out. Type your abbreviation and you’ll be instantly taken to the path you entered. Time to get to work making these for all your commonly used folders!

Create shortcuts for repetitive selections

TextExpander is even more powerful that that, though. There are some cases where you frequently travel to a file or folder that matches certain conditions but is different each time. I, for example, frequently want to open the last screenshot that I took. Here’s where a little shell scripting comes in. Create a new snippet in your Paths group and give it an abbreviation (I chose /lshot). Set the Content field to Shell Script by clicking its menu and paste the following code in:

#!/bin/bash
set -e
cd ~/Desktop
thefile=$(ls -t "Screen Shot" | head -n 1)
echo -n "~/Desktop/$thefile"
osascript -e 'tell application "System Events" to key code 36'

Basically, this script finds the most recently modified file on your Desktop with the words ‘Screen Shot’ in its name. If you store your screenshots somewhere other than your Desktop, you’ll have to change the path in the third and last line. That last line presses the return key. Be sure to include that in your own scripts if you want navigation to take place automatically.

Now you can type one word in any open dialog and have the most recently-taken screenshot be selected for you. I’m sure that everyone has other interesting situations where TextExpander is helpful in open/save dialogs. If you’ve got a cool one, post your script in the comments. If you need help writing your script, ask on Ask Different or the Unix Stack Exchange site. If you’re an AppleScript fan, note that you can also use AppleScripts in TextExpander snippets.

I hope this article will help you be more efficient in open/save dialogs. If you’ve got any questions or tips to share, feel free post in the comments below.

Filed under OS X Tutorial

7 Comments

Subscribe to comments with RSS.

  • Daniel says:

    Awesome post, Nathan. My favorite trick that you didn’t mention is drag and drop — if you have a file in a Finder window and you want to navigate to it in an open or save dialog, drag the file from the Finder window and drop it in the open or save box — the box will navigate to its containing folder and select that file.

  • Great post! To anyone who is reading this comment and is interested in maybe purchasing TextExpander, I’d actually even more heartily recommend Keyboard Maestro. It’s only one dollar more ($36), and in addition to text expanding, it also supports all sorts of macros to control interfaces, run commands, and automate tasks.

  • Jeff says:

    This won’t expand text – but it DOES make life better w/ open and save dialog boxes… (favorites, history of where you’ve been saving files, etc.) Default Folder X

    http://www.stclairsoft.com/DefaultFolderX/

    I’ve been using it a long time, and am a big fan. However, I also really enjoyed learning these keyboard shortcuts. I had NO idea you could apple-shift-. to show and hid invisibles!

    Great post!

  • Comments have been closed for this post