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

Mr_Brightside_@

macrumors 68040
Original poster
Sep 23, 2005
3,885
2,400
Toronto
I have users who have snap to grid turned off and sort by None, so they can move things around wherever they want on their Desktop. Sometimes, they inadvertently turn on sort by, and can't find anything.
Since we all maintain Time Machine backups, is there a .plist (or other file) that controls the layout that I could attempt restoring?
I experimented with ~/Library/Preferences/com.Apple.desktop.plist but restoring it after changing sort by didn't make a difference.
 
It's probably the .DS_Store file in the folder of interest. The file has a binary format, and isn't a plist as far as I know.

I'm honestly not sure if this file is used for the Desktop view, but it should be easy to test. Simply change some setting on how the Desktop is viewed, and see if the file's modification-date changes.

Another thing is that the Finder might cache the contents of these files, so you might need to do some clever juggling, instead of just overwriting the file. The juggling sequence I'd start with:
0. Make sure Finder's view-settings window for Desktop is closed.
1. Rename ~/Desktop/.DS_Store to ~/Desktop/bad
2. Restore earlier file to ~/Desktop/.DS_Store
3. Immediately restart.
4. Delete ~/Desktop/bad​

If this doesn't work, ask again and I'll post a different juggling sequence.
 
Thanks so much for the thorough response!

I ran defaults write com.apple.finder AppleShowAllFiles YES and relaunched Finder, but it's not showing .DS_Store files as it has done in the past. It seems like this might be a High Sierra thing. Any tips on showing them? Finder > Go to Folder doesn't reveal it if I manually enter it.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.