Skip to content

Instantly share code, notes, and snippets.

@AAS
Created March 14, 2012 14:37
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save AAS/2036916 to your computer and use it in GitHub Desktop.
Save AAS/2036916 to your computer and use it in GitHub Desktop.
OS X 10.7 Lion Finder - Folders on top
Open Terminal.
Type this command:
cd /System/Library/CoreServices/Finder.app/Contents/Resources/English.lproj/
Now, the file we want to mess around is the InfoPlist.strings. But unfortunately, this file cannot be edited directly using text editor in Lion. But no worries. Run this command to make it editable.
sudo plutil -convert xml1 InfoPlist.strings
Now the file should be editable and readable. Use your favorite text editor and open InfoPlist.strings. I just used vim
sudo vim InfoPlist.strings
Inside you’ll find XML document. Go to the following lines:
<key>Folder</key>
<string>Folder</string>
All you have to do is to add a space before the second Folder like this:
<key>Folder</key>
<string> Folder</string>
Save the file. Convert the file to binary again using the following command.
sudo plutil -convert binary1 InfoPlist.strings
Restart Finder.
killall Finder
That’s it!
http://nicnocquee.com/put-folders-on-top-when-sort-by-kind-in-mac-o
@gluxon
Copy link

gluxon commented Feb 23, 2013

Very helpful. Thanks!

@billypuntove
Copy link

I did this once via TextEdit and it worked wonderfully for months (maybe more than a year?) but something happened this week (something I pressed, trying to get files sorted) and all went to hell— meaning my folders were not on top.
I tried to do this and realized that the info on my Finder InfoPlist.strings file now looks like this:

    <key>AFP Internet Location</key>
    <string>AFP Internet Location</string>
    <key>AFP URL</key>
    <string>AFP URL</string>
    <key>AppleTalk Internet Location</key>
    <string>AppleTalk Internet Location</string>
    <key>Burn Folder</key>
    <string>Burn Folder</string>
    <key>CFBundleName</key>
    <string>Finder</string>
    <key>Clipping</key>
    <string>Clipping</string>
    <key>FTP Internet Location</key>
    <string>FTP Internet Location</string>
    <key>FTP URL</key>
    <string>FTP URL</string>
    <key>File Internet Location</key>
    <string>File Internet Location</string>

Why would this be? And would it be a good idea to just replace it with what is supposed to be there originally if you were to send it to me?

I hope this gets to you and you can help me out.

Cheers, and happy St. Paddy's!

Billy.

@antonywu
Copy link

antonywu commented Jul 2, 2013

This does not seem to work in 10.8.4 anymore?
I tried to sort a folder content by Name, so ideally, I would expect folders are sorted by themselves at the top with files sorted by themselves below folders. But even with this fix, it doesn't seem to have any behavior changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment