Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ProQuiz

macrumors regular
Original poster
Jul 15, 2009
202
73
Is there a way to reset a window's (specifically the macOS System Settings window) size and position? If yes, what do I need to do?
 

bogdanw

macrumors 603
Mar 10, 2009
5,719
2,751
Yes, close System Settings, from Terminal run
Code:
defaults delete ~/Library/Preferences/com.apple.systempreferences.plist "NSWindow Frame main"
You might have to grant Terminal temporary Full Disk Access.
 

ProQuiz

macrumors regular
Original poster
Jul 15, 2009
202
73
Yes, close System Settings, from Terminal run
Code:
defaults delete ~/Library/Preferences/com.apple.systempreferences.plist "NSWindow Frame main"
You might have to grant Terminal temporary Full Disk Access.
Thanks. This will only reset and window size and position for System Settings and nothing else like settings/preferences or anything?
 

bogdanw

macrumors 603
Mar 10, 2009
5,719
2,751
Thanks. This will only reset and window size and position for System Settings and nothing else like settings/preferences or anything?
Yes, only the size and position of System Settings.
Just in case, make a copy of the file ~/Library/Preferences/com.apple.systempreferences.plist
 

ProQuiz

macrumors regular
Original poster
Jul 15, 2009
202
73
Yes, only the size and position of System Settings.
Just in case, make a copy of the file ~/Library/Preferences/com.apple.systempreferences.plist
Thanks. I did it before reading your last post. It worked. Didn't make a copy of the file but it is still there and now has different parameters for the window size and position.
 

ProQuiz

macrumors regular
Original poster
Jul 15, 2009
202
73
Is there a Terminal command to reset the Mac App Store's window size and position?
 

bogdanw

macrumors 603
Mar 10, 2009
5,719
2,751
Is there a Terminal command to reset the Mac App Store's window size and position?
Yes:
Code:
defaults delete ~/Library/Preferences/com.apple.AppStore.plist "NSWindow Frame AppStoreMainWindow"
 

ProQuiz

macrumors regular
Original poster
Jul 15, 2009
202
73
Thank you!

Is it necessary to restart your Mac or anything after running these Terminal commands?
 

bogdanw

macrumors 603
Mar 10, 2009
5,719
2,751
Is it necessary to restart your Mac or anything after running these Terminal commands?
No. Just close the app, run the command, open the app and the position should be reset to the default location.
 

ProQuiz

macrumors regular
Original poster
Jul 15, 2009
202
73
No. Just close the app, run the command, open the app and the position should be reset to the default location.
Is there a way for me to find out the Terminal command for resetting various app window sizes and positions myself?
 

ProQuiz

macrumors regular
Original poster
Jul 15, 2009
202
73
By the way, do these window size and position commands also work for third-party apps or only macOS native apps?
 

bogdanw

macrumors 603
Mar 10, 2009
5,719
2,751
Usually, window size and position values are saved in the application’s preference file. You have to identify the preference file of the app and delete the key that stores the values, most likely to start with NSWindow.

Rather than from Terminal, it’s probably easier to use a free app like Prefs Editor https://apps.tempel.org/PrefsEditor/
 

ProQuiz

macrumors regular
Original poster
Jul 15, 2009
202
73
Usually, window size and position values are saved in the application’s preference file. You have to identify the preference file of the app and delete the key that stores the values, most likely to start with NSWindow.

Rather than from Terminal, it’s probably easier to use a free app like Prefs Editor https://apps.tempel.org/PrefsEditor/
I assume resetting the window size and position is possible for third-party apps as well? Or do such Terminal commands only work for macOS native apps?
 

ProQuiz

macrumors regular
Original poster
Jul 15, 2009
202
73
Okay, thanks. Will come back to you in case I need to reset a window but can't find/identify the application's preference file.
 
Last edited:

ProQuiz

macrumors regular
Original poster
Jul 15, 2009
202
73
Few more:

What are the Terminal commands for resetting the window size and positions of:

Finder when you click on the Finder icon on the Dock
Downloads folder when you click on the "Open in Finder" on Downloads on the Dock
Trash when you click on the Trash on the Dock

Apparently they all save individual window size and positions.
 
Last edited:

bogdanw

macrumors 603
Mar 10, 2009
5,719
2,751
They are saved in com.apple.finder (~/Library/Preferences/com.apple.finder.plist)
ComputerViewSettings - WindowState - WindowBounds
TrashViewSettings - WindowState - WindowBounds
A little bit more complicated to reset :)
Code:
/usr/libexec/PlistBuddy -c "Delete :ComputerViewSettings:WindowState:WindowBounds" ~/Library/Preferences/com.apple.finder.plist

/usr/libexec/PlistBuddy -c "Delete :TrashViewSettings:WindowState:WindowBounds" ~/Library/Preferences/com.apple.finder.plist

killall Finder
 
  • Like
Reactions: CaptainAndrew

ProQuiz

macrumors regular
Original poster
Jul 15, 2009
202
73
How do I enter all of that in Terminal? One line at a time, press Enter then enter the next line?

I entered the first line of code in Terminal and received the following message:

Delete: Entry, ":ComputerViewSettings:WindowState:WindowBounds", Does Not Exist
 

bogdanw

macrumors 603
Mar 10, 2009
5,719
2,751
If I may ask, wouldn't be easier to just resize & position the windows how you want them? :)

Yes, one at a time, Enter after each one. Instead of the last one (killall Finder), you can Option & right-click on the Finder icon in the Dock and Relaunch.

To read the current values
Code:
/usr/libexec/PlistBuddy -x -c "Print :ComputerViewSettings:WindowState:WindowBounds" ~/Library/Preferences/com.apple.finder.plist

Code:
/usr/libexec/PlistBuddy -x -c "Print :TrashViewSettings:WindowState:WindowBounds" ~/Library/Preferences/com.apple.finder.plist
 

ProQuiz

macrumors regular
Original poster
Jul 15, 2009
202
73
True, but I am somewhat of an OCD perfectionist. :p

When I enter the lines of code in Terminal, it says :ComputerViewSettings:WindowState:WindowBounds and :TrashViewSettings:WindowState:WindowBounds do not exist.

By the way, if it is too much of a hassle or time consuming to figure it out, don't worry about it. I'll probably just resize them manually.
 

ProQuiz

macrumors regular
Original poster
Jul 15, 2009
202
73
Thanks.

However, it didn't work. Keeps saying "does not exist". Anyway, I found an easy way to do it manually. All good now.
 

ProQuiz

macrumors regular
Original poster
Jul 15, 2009
202
73
Well, the commands started working. Must have done something wrong on my end the first time around.
 
Last edited:

K1bw0rth

macrumors newbie
Feb 2, 2024
2
0
Hi, another OCD perfectionist here :)
I hope it is alright that I add a question to this topic as it is very similar in nature and I'd like to ask it in this context specifically.
@bogdanw, you are obviously skilled and patient, I wonder if you might help me with the corresponding Terminal command to reset the default width of the Finder Sidebar. (My issue is that CC took the liberty of adding a folder with a very long name to Favourites and expanded the Sidebar. Removing the folder does not reinstate the original proportions and I would like to undo this without dragging, if possible). Thank you in advance and apologies if this is considered off topic.
 

bogdanw

macrumors 603
Mar 10, 2009
5,719
2,751
the corresponding Terminal command to reset the default width of the Finder Sidebar.
To reset the Sidebar width to the default value:
Code:
defaults delete ~/Library/Preferences/com.apple.finder.plist SidebarWidth
Close all Finder windows before running the command. A new window should open with the default Sidebar width. If it doesn’t, try to restart Finder.
 
  • Like
Reactions: CaptainAndrew
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.