So I’m a bit of an OCD nut when it comes to how I set things up on my Mac, especially in the Finder. I like to have three windows open at all times: one large one pointing to my general “Work” folder, a smaller one that’s connected to my local server, and another over to the side that’s a  Smart Folder, listing all recently-modified files (in my “Work” folder), so that I can easily access what I’ve been working on recently. 
And not only do I like to have these three windows open at all times, but I like to have them set up in a certain way too: a certain size, a certain position on the screen, set to a certain view, etc.
Naturally, during any normal working day, it’s to be expected that these folders might get moved or re-sized or closed, so I like to be able to get them back to how I had them set up originally, and it’s a hassle to have to manually do this, clicking, dragging, re-sizing, etc.
New MacOS technologies such as window-snapping go some way to helping this, and there are also apps like Magnet as well, but they just don't set things up exactly how I wanted them.
So I set about coming up with my own way of fixing this. I find it very helpful, and I thought you might too…
The first thing to do is set up your Finder windows exactly how you want them. Take your time, as this is how they’re going to be positioned from here on. Position them precisely where you want them. Scale them to the exact size you want. Navigate to the folders you’d like to have as the default location. Set your view options, such as Icons or List. Set your icon size. Do you want the toolbar / statusbar / sidebar visible. You get the picture…
Now that we have got our Finder windows set up just the way we want them, we need to find out all the various properties of each of these windows, so that we can note them down and call them back.
So open up Script Editor in your Utilities folder, type the following into the top section of a new window, and hit the Run/Play button:
tell application "Finder"
get properties of windows
end tell
In the bottom of this same window, you will get the Result listed. 
As it stands, it might not mean very much, and to be honest, it’s probably way more information than what you actually need.
What also doesn’t help is that you’ve got the results for multiple windows all smooshed together in one Result. So let’s see what it looks like if you just target one window instead. Delete what you wrote originally, and type this instead:
tell application "Finder"
get the properties of the front Finder window
end tell
As you can see, now we’re only getting the properties of whatever is the currently-selected window in your Finder.
It’s a lot shorter, but it’s probably still more information than you need. You likely won’t need to alter properties that relate to whether things are zoomed, or floating, etc.
What we really need are just a few key properties: the target (the file path), the bounds (the size and position of the window), the current view (icon, list, etc.), and possibly a few others, depending your personal preferences.
What I list below assumes you want to record just a few key properties, but based on the results you get when listing ALL properties above, I’ll leave it up to you to edit it further to add anything else you choose to.
So now that we have recorded the various properties of our Finder windows, we want to set up a script that implements these properties back on to a Finder setup that has deviated from this.
So that we don’t lose the properties we recorded earlier, open up a new script window.
The first thing we will do is tell our script what application we want to target, and in this case, it’s the Finder. So we type:
tell application "Finder"
Then, because we may already have windows open, if we just ran our script now, it would add more windows to what is already open in the finder. So the next thing we do is close any windows that might currently be open:
close every window
Now we can start implementing the properties we recorded earlier. To get our target (the file path), simply type:
And then from your previously-recorded Result, locate the word “target”. Note that you can just click anywhere in the Result window, hit Cmd-F, and type “target” to locate the relevant line. Now copy everything after the semicolon after the word “target” up to and including the phrase “startup disk”.
Once you’ve copied that, go over to your other script window and paste it in after the word “open”.
So for example, if I wanted to open my Documents folder, it would look something like this:
open folder "Documents" of folder "brettarchibald" of folder "Users" of startup disk
Next we want to set the bounds (the size and position of the window).
So on another line, type:
set the bounds of the front Finder window to 
Again, go back to your previously-recorded Result, and this time locate the word “bounds”.
Now just copy the curly-brackets and the four numbers within them. Go back to your script and past this after the word “bounds”, so that it reads something like:
set the bounds of the front Finder window to {0, 23, 1441, 813}
I’m sure by now you’re getting the hang of how it works, so I won’t go through every single line. You can see a more detailed list at the bottom of this page.
What I will say is that the above two lines, relating to “target” and “bounds” relate to only the one Finder window. For any other Finder windows, you will need to repeat those lines, swapping out the relevant properties from your previously-recorded Results.
Then when you have finished, you need to tell your script that you have finished. So because you started your script with a “tell” command, you need to finish with:
end tell
To test your script, simply hit the Run/Play button, and it will play through, performing the steps outlined in your script. If you have your Finder visible behind your Script Editor application, you will see the windows opening and positioning themselves correctly.
Obviously, in order to play this script again in future, rather than opening up the Script Editor application and re-doing all this work each time, we can just save this script to run as we have saved it.
The first step that I would recommend is to save the script as an editable script somewhere, so that you can come back to it later and adjust it or add to it, if needs be. So firstly, choose File > Save, and then under the File Format option, choose Script from the dropdown, and give it a name. Now that the script is saved, we can export it as a standalone application. Choose File > Export, and now under the File Format option, choose Application. To keep your application name tidy, I’d recommend ticking the “Hide extension” checkbox, otherwise your application will have a “.app” at the end of it.
And that’s it. To keep your application handy, I’d recommend adding it to your Dock, so you can click on it any time things get messy in the Finder and you want to get your meticulously-positioned windows setup back.
You might also want to add a custom icon to the application, so that it looks both more attractive and more intuitive in your dock. If you want to use the icon that I have created, you can download it here. Or if you’d prefer to make your own icon, there’s a great tutorial here on how to set one up in the right format.
Finally, you could also set your application to run every time you start up your Mac, so that you always starts out with a tidy Finder. To do this, Ctrl-click on the icon in the Dock, and under the Options flyout, choose “Open at Login”.
If you’re interested, and if it helps, below is the script that I personally have set up for my own personal preferences. Note that any line that starts with a # is a commented line, that’s just there to add handy notes about the script.
If you have found this script useful, I’d love to hear about it. Drop me a line and let me know.
tell application "Finder"
close every window
open document file "Recent Work.savedSearch" of folder "Library" of folder "brettarchibald" of folder "Users" of startup disk
set toolbar visible of the front Finder window to true
set the sidebar width of the front Finder window to 0
set the current view of the front Finder window to icon view
set icon size of icon view options of front Finder window to 192
set arrangement of icon view options of front Finder window to arranged by modification date
set the bounds of the front Finder window to {1441, 23, 2380, 1436}
open folder "Shortcuts" of folder "Documents" of folder "brettarchibald" of folder "Users" of startup disk
set toolbar visible of the front Finder window to true
set the sidebar width of the front Finder window to 180
set the current view of the front Finder window to column view
set the bounds of front Finder window to {0, 814, 1441, 1435}
open folder "WORK" of folder "Dropbox" of folder "brettarchibald" of folder "Users" of startup disk
set toolbar visible of the front Finder window to true
set the sidebar width of the front Finder window to 180
set the current view of the front Finder window to column view
set the bounds of the front Finder window to {0, 23, 1441, 813}
end tell
Back to Top