Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Save to frontmost Finder window without the mouse System
Nine out of ten times that I want to save a document, it's to the front most Finder window. However, that window is often behind lots of other applications, each of which my have many windows open. I love the fact that you can drag and drop the folder icon from the top of a Finder window into the save dialog, but I've found that that often requires me to do a bit of shuffling of windows.

I've come up with an AppleScript that I launch with Butler (that's optional, of course) that puts the path of the frontmose Finder window into the clipboard. That way when I'm saving a document, at the point at which the save dialog comes up, I can then run the script via Butler, and hit Shift-Command-G to bring up the "Go to" dialog. Then I just paste the clipboard and get the path I need to save where I want.

I've included a commented-out piece that perhaps a more savvy person can get to work. This would basically eliminate some of these last keystrokes. The problem seems to be related to the fact that "Go to" belongs to the Finder or maybe the OS, and although it may be summoned in apparently in any application's save dialog, it chokes when calling it via System Events -- presumably because the front app won't own Shift-Command-G, but that it is rather called by the OS somehow.

[robg adds: While I don't know the answer to the AppleScript question, you can sort of work around it with Butler. Previous comment deleted.

Addendum: Peter Maurer, Butler's author, has provided the one-keystroke solution in the comments. Thanks, Peter!]
  • Currently 3.00 / 5
  You rated: 5 / 5 (4 votes cast)

Save to frontmost Finder window without the mouse | 9 comments | Create New Account
Click here to return to the 'Save to frontmost Finder window without the mouse' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Ideas to reduce keyboarding
Authored by: sinjin on Nov 29, '05 08:38:20AM

I like what you've started here, very useful.

I don't have time to experiment with it right now but I suspect that since scriptable applications have a "save" command you could "tell the target app" to save to "to window 1 of the finder" without the GUI scripting complications. BUT have a try block that captures failures to save (what may happen with non-scriptable apps) and resort to the GUI stuff with extra keystrokes.

Just off the top of my head, not sure if it would work out quite like that!

[ Reply to This | # ]
Save to frontmost Finder window without the mouse
Authored by: DougAdams on Nov 29, '05 09:04:05AM
I use the trusty Default Folder for this ( Among its other amazing abilities, it will allow you to select any open window in Open/Save dialogs by pointing to its location on the desktop, even if it is buried. Worth every shareware penny and I can't live without it.

Doug's AppleScripts for iTunes

[ Reply to This | # ]

Save to frontmost Finder window without the mouse
Authored by: luhmann on Nov 29, '05 10:01:06AM

I think you want Default Folder X

[ Reply to This | # ]
Save to frontmost Finder window without the mouse
Authored by: Peter Maurer on Nov 29, '05 10:29:02AM
Here's a one-click solution for Butler. This is a container which will run its contents whenever you press [shift]-[option]-[command]-[s].

Once you press that key combo, this is what Butler does:
  1. Fake a [shift]-[command]-[s] keystroke, which summons the "Save as..." dialog in well-behaved applications.
  2. Fake a [shift]-[command]-[g] keystroke to trigger the "Go to..." dialog.
  3. Run galaher's script, which is stored in an "AppleScript" smart item. This smart item is configured to paste its result when done.
  4. Fake a [return] keystroke to confirm the "Go to..." dialog.
Now enter a file name, press [return], and you're done.

Depending on your mac's speed, you might have to tweak the "Keystrokes" smart items' delays a little. And by the way, doing it this way will also preserve your original pasteboard content.

[ Reply to This | # ]
Just drag the folder icon to the save dialog box...
Authored by: dbs on Nov 29, '05 10:48:40AM

Another option is to just drag the folder of the frontmost window (easy if it's in column view) to the save dialog box. This will cause the save dialog to go into that folder. If you have the middle mouse button set to do expose this is really very easy.

If the window isn't in column view just drag the icon in the window title bar.

[ Reply to This | # ]
Why is this needed?
Authored by: SOX on Nov 29, '05 10:51:06AM

Seems like for the same amount of work you could
1) click the finder icon to bring up the top most window
2) drag the title bar
3) if the save-as sialog is not visible then
3a) use expose
3b) or alternatively use command shift tab to switch back to the app
4) drop it.

[ Reply to This | # ]
Why is this needed?
Authored by: robg on Nov 29, '05 11:44:21AM

If you look at Peter's solution above, you can do all of this with one keystroke now. Seems much simpler to me :).

But hey, it's always nice to have choices!


[ Reply to This | # ]
Insight into the power of Butler
Authored by: galaher on Nov 29, '05 01:03:04PM

I second that. I think that having choices is the key here. An operating system that lets you work the way you want, is one of the things that make the mac great.

I'd also like to thank Peter Maurer for his response. I found it did just what I wanted, but equally important, it was great to have a working example of some Butler features I didn't quiet grasp/understand. Great stuff! Thank you.

P.S. I use the Dvorak keyboard layout, and I found my Smart Item Keystrokes didn't map properly (I suspect this is an OS issue as Application Switcher and a few other processes seem to not honor alternate keyboard inputs/mapping as discussed elsewhere on this site). However once I realized this and I changed the keystrokes appropriately, butler worked as expected.

[ Reply to This | # ]
Save to frontmost Finder window without the mouse
Authored by: CkB_Cowboy on Dec 01, '05 10:04:45AM
I actually wrote an applescript that does something similar to this; it gives you a list of all the open Finder windows and lets you choose which one, then it copies that path to the clipboard.

Finder Copy Open Window Paths v 1.0

It might help.

- Cowboy

My ill-matic homepage:
My Applescripts:

[ Reply to This | # ]