Close All But The Current Finder Window 10

Apple Script

Share
Close All But The Current Finder Window

Hey

If you Finder extensively to move around windows and files you will probably end up with a lot of Finder windows open. I like things neatly organised. The problem with this is that you can end up with a lot of screen clutter. With the help of the Internet I have come up with a quick Applescript that you can use to close every window but the one you are using. Its really simple to make and run.

First open up the Apple script editor in Applications and type or copy and paste the following code:

tell application "Finder"
repeat while window 2 exists
close window 2
end repeat
end tell

Hit the compile button. Then go to File > Save As and set the File Format to Application. At the same time check the Run Only option and uncheck Startup Screen. Save this into a suitable place on your hard drive.

Open up a Finder window and drag your script into the sidebar or any other suitable location.

Then, to test, open up a couple of Finder windows. Hit that button and watch them close. The script will run where it will close every Finder window but the one you are using. Neat.

A quick Applescript tip that has saved me a lot of time. Also you can press Command + Option + W to close every window. You can also use the Command + Option key command while pressing the buttons in the top left of any window.


If you want to keep up with the latests post from Mac Tricks And Tips I recommend you subscribe to the RSS Feed.

Where To Next?

  • Subscribe To Mac Tricks And Tips