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

Clone the current Finder window Desktop

If you're like me, you like to move things around a lot. And you hate having to constantly Ctrl-N and drill through endless subdirectories to reach the folder you want, which is usually just a few clicks away from the folder you're looking at.

This Applescript gets the location of the frontmost Finder window and opens a second with the same path and view. When no windows are open, it launches a new one at the system root, or you can substitute your preferred target.

tell application "Finder"
get the exists of the front Finder window
if the (exists of the front Finder window) is true then
try
set newWindow to target of front window
set oldView to current view of front window
make new Finder window to newWindow
set current view of front window to oldView
end try
else
try
make new Finder window to alias ":"
set the current view of the front Finder window to column view
end try
end if
end tell

It's fastest when called from the Script Runner[1] rather than as a toolbar application. I'm sure someone better at Applescripting can make a more useful version by combining it with the script from this tip.

[1] Save as compiled and name it something like "Attack of the Finder Clones" to put it at the top.

    •    
  • Currently 2.50 / 5
  You rated: 3 / 5 (4 votes cast)
 
[8,356 views]  

Clone the current Finder window | 13 comments | Create New Account
Click here to return to the 'Clone the current Finder window' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Other way to do it
Authored by: aranor on Feb 01, '02 10:43:56AM

If I ever want to do this, the quickest way in my opinion is the following:

Hold command
Double-click on a folder
In the new window, press Cmd-B to bring back the toolbar
Press cmd-up arrow

Voila!



[ Reply to This | # ]
Other way to do it
Authored by: betabug on Feb 02, '02 02:41:18AM

It's nice to also set the bounds:
That way windows always have my prefered size. Just have to move them to the spot you want
them, as they get set on top of the "cloned" window.

tell application "Finder"
get the exists of the front Finder window
if the (exists of the front Finder window) is true then
try
set newWindow to target of front window
set oldView to current view of front window
-- added this line:
set windowBounds to bounds of front window
make new Finder window to newWindow
set current view of front window to oldView
-- added this line:
set bounds of front window to windowBounds
end try
else
try
make new Finder window to alias "pan:"
set the current view of the front Finder window to column view
end try
end if
end tell



[ Reply to This | # ]
Let's try again :)
Authored by: jimhoyt on Feb 02, '02 04:21:00PM
This'll keep it from using your disk name...
-- added this line:
property this : ""

tell application "Finder"
get the exists of the front Finder window
if the (exists of the front Finder window) is true then
try
set newWindow to target of front window
set oldView to current view of front window
-- added this line:
set windowBounds to bounds of front window
make new Finder window to newWindow
set current view of front window to oldView
-- added this line:
set bounds of front window to windowBounds
end try
else
try
-- changed this line:
make new Finder window to alias this
set the current view of the front Finder window to column view
end try
end if
end tell


[ Reply to This | # ]
Setting bounds
Authored by: Anonymous on Feb 08, '02 11:19:42AM
How about instead setting the bounds like this:
  --snip--
try
	set newWindow to target of front window
	set theBounds to the bounds of front window
	set oldView to current view of front window
	make new Finder window with properties {bounds:theBounds} to newWindow
	set current view of front window to oldView
end try
	--snip--

     

[ Reply to This | # ]
Command-Down Arrow
Authored by: DougAdams on Feb 03, '02 01:39:53PM

What's Command-Down Arrow for then?



[ Reply to This | # ]
A little tweak...
Authored by: Algorythmn on Feb 02, '02 04:22:21PM
Actually, this line is unnecessary:
    get the exists of the front Finder window
"exists" is a built-in command of the Finder, so your if-check is all you need.

[ Reply to This | # ]
Great idea! Here's my modified script
Authored by: Anonymous on Feb 03, '02 08:57:05PM

I edited a version of my original script that was further edited by James Sorenson and added your mods to it. It is even more useful now!

Here's the new script. I drag the script to the dock so it's always handy to launch. I also put a new copy of it on my idisk available here, it's called Tandem

http://homepage.mac.com/yuriwho

--FinderInit.scpt
--This script activates DragThing, opens two finely positioned Finder Windows, and opens the Info Window
-- if a current finder window is open, both new windows will open to the same folder of the current finder window
-- if no windows are open, it will open the top window in the /Applications directory & the bottom window on root directory (useful for installing apps from dmgs)

--True Monitor size
property monitor_width : 1024
property monitor_height : 768
--Thicknes of titlebars (to prevent overlapping)
property menubar : 23
--Margins to make room for DragThing, Dock, Desktop items, etc
property leftmargin : 0
property rightmargin : 100
property topmargin : 0
property bottommargin : 0
--Height and width of the Info Window (will be placed to the right of the bottom window)
property infowidth : 280
property infoheight : 335


--Bring DragThing to the front (uncomment the following lines to activate dragthing)
--tell application "DragThing"
--activate
--end tell

tell application "Finder"
if the (exists of the front Finder window) is true then
try
--set the directory the upper new window to match the current front finder window
set folder1 to target of front window
set folder2 to target of front window
--uncomment the following line to have folder2 go to the startup disk (this is useful for installing software from disk images
--set folder2 to the startup disk
end try
else
try
--set default directory (Notice that "home" represents your home directory)
set folder1 to "Applications"
--This is how you can refer to a subdirectory in your Home directory
--set folder2 to ((home as string) & "Documents") as alias
--Use this if you'd prefer your bottom folder to go to root
set folder2 to the startup disk
end try
end if

--clean up
activate
close every Finder window

-- BOTTOM WINDOW
set bot_window to make new Finder window
set the target of bot_window to folder2
--monitor origin is upper-left corner
--{left,top,right,bottom}
set the bounds of bot_window to {leftmargin, (monitor_height - infoheight - bottommargin), (monitor_width - rightmargin - infowidth), (monitor_height - bottommargin)}
set the current view of bot_window to column view

-- TOP WINDOW
set top_window to make new Finder window
set the target of top_window to folder1
--monitor origin is upper-left corner
--{left,top,right,bottom}
set the bounds of top_window to {leftmargin, topmargin + (menubar * 2), (monitor_width - rightmargin), (monitor_height - infoheight - bottommargin - menubar)}
set the current view of top_window to column view

-- INFO WINDOW
--Applescript currently can't set the position or bounds of the Info Window.
--Just move it to where you want it, close it, then open it. From then on, it will open in the proper place.
open information window of folder2
--set info_window to the information window
--set the position of info_window to {(monitor_width - rightmargin - infowidth), (monitor_height - infoheight - bottommargin)}

--Reactivate TOP WINDOW
select top_window
end tell



[ Reply to This | # ]
What about Command-Down Arrow
Authored by: DougAdams on Feb 04, '02 06:43:54AM

Command Down Arrow on an open folder (without selecting anything inside it) will clone the folder window.



[ Reply to This | # ]
What about Command-Down Arrow
Authored by: Anonymous on Feb 05, '02 12:35:29AM

Command-Down Arrow does not behave that way on my system, it just opens the folder in the current finder window. Regardless, even if it did, that is nothing like what the modified script does. Try downloading it from my homepage (http://homepage.mac.com/yuriwho), drag the script to the dock and next time you need to copy some files somewhere, just click the script icon in the dock. (note you may have to edit the first few lines in the script to adjust it for your preferred set-up...dock at the bottom, different screen resolution etc.)

Y



[ Reply to This | # ]
What about Command-Down Arrow
Authored by: DougAdams on Feb 05, '02 05:38:56AM

Agreed, your applet is much more elaborate, but that doesn't change the fact that on my System Command-Down Arrow on an open folder window -- or on a selected folder in column view -- clones the window.



[ Reply to This | # ]
What about Command-Down Arrow
Authored by: Anonymous on Feb 08, '02 11:23:45AM

Doug -

Cmd-downarrow does not open folders in new windows on my system. I suspect you have your Finder prefs set to "always open folders in new windows."



[ Reply to This | # ]
What about Command-Down Arrow
Authored by: DougAdams on Feb 09, '02 07:42:54AM

Ah! Yes, of course!



[ Reply to This | # ]
What about Command-Down Arrow
Authored by: man_in_the_moon on Feb 14, '02 12:43:13AM

very curious..

command-down arrow works fine on my system, cloning the current window, and I *definitely* don't have my Finder prefs set to "always open folders in new windows."

interestingly, it only clones 1 copy, then it flips back to the original and back and forth. Clones of clones works fine too.

X 10.1

;o]>



[ Reply to This | # ]