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

AppleScript to open new Finder window in same folder as frontmost window System
A user at Stack Exchange asked an interesting question recently : how can you open a new Finder window in the same folder as the frontmost window? When you open a new Finder window (Command-N in the Finder), it opens to the folder you've set in the Finder's General preferences. There may be some situations when you want to duplicate the current window, such as when you're moving files around among sub-folders in a specific folder.

Another reader, Lauri Ranta, posted a simple AppleScript, that you can use together with a keyboard shortcut, to do just this. When you run the script, it creates a new window at the same location as the frontmost window. Here's the script:
tell application "Finder"
    try
        target of window 1
        make new Finder window to result
    on error
        make new Finder window to home
    end try
end tell
Save this as a script, and use any tool that can apply keyboard shortcuts to AppleScripts. Or save it as an application, drag it to the Finder window toolbar, and it'll be just a click away. (You can move the application to any location you want afterwards.)
    •    
  • Currently 3.67 / 5
  You rated: 4 / 5 (6 votes cast)
 
[5,955 views]  

AppleScript to open new Finder window in same folder as frontmost window | 6 comments | Create New Account
Click here to return to the 'AppleScript to open new Finder window in same folder as frontmost window ' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
AppleScript to open new Finder window in same folder as frontmost window
Authored by: dajaka on May 10, '13 10:20:52AM

or just add the New Folder item to the finder toolbar (Finder/View/Customize Toolbar). It opens a new folder in the current window.



[ Reply to This | # ]
AppleScript to open new Finder window in same folder as frontmost window
Authored by: kirkmc on May 10, '13 11:44:03AM

This isn't about creating a new folder, it's about making another window of the same folder as the one that's visible in the frontmost window. Hard to grasp, I know...

---
Mac OS X Hints editor - Macworld senior contributor
http://www.mcelhearn.com



[ Reply to This | # ]
AppleScript to open new Finder window in same folder as frontmost window
Authored by: zpjet on May 10, '13 11:08:30AM

Hey, good hint, I found out being in the situation once in a while.

So if you don't want to use any third party and still being able to run it with a shortcut, use Automator, make new Service, add the script with Run AppleScript, save it as eg. New Same Window and assign the shortcut via System Preferences > Keyboard > Keyboard Shortcuts.

Works like a charm...



[ Reply to This | # ]
AppleScript to open new Finder window in same folder as frontmost window
Authored by: Strod on May 10, '13 01:00:39PM
Nice hint, but the situation given as an example of when this would be useful is bogus. From the hint:
There may be some situations when you want to duplicate the current window, such as when you're moving files around among sub-folders in a specific folder.
If you ever find yourself in that situation, just Command-double-click on one of the sub-folders: now you "magically" have two windows, one of them in the sub-folder you chose.

In fact you can select all the subfolders you want to "move files around among", then command-double-click one of them and now you have windows on each of the desired sub-folders, no Applescript needed.

I'm sure we can come up with other situations where the hint would actually be useful, though.

[ Reply to This | # ]

AppleScript to open new Finder window in same folder as frontmost window
Authored by: adayzdone on May 10, '13 07:55:57PM

The script be:
target of finder window 1

If not, other windows such as information windows will throw an error even if a Finder window exists.



[ Reply to This | # ]
AppleScript to open new Finder window in same folder as frontmost window
Authored by: johannsnyman on May 11, '13 12:21:19AM

Very useful hint, thanks! I used it to make a new workflow in Alfred, works very well!



[ Reply to This | # ]