Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to have folders first before any file in finder (Mac) programmatically?

I am new to Mac OS. I want to have the folders first before any other file in finder through my cocoa app.

Can anyone suggest me a way of doing this like xtraFinder, PathFinder etc apps do?

I have gone through the followings links. One way is this:

http://hints.macworld.com/article.php?story=2011072120153685 http://mygeekdaddy.net/2013/10/24/change-mavericks-finder-app-sort-order/

And the other way I got is to drag the folders to first in the spotlight (in system preferences) then sort by kind.

But in both ways I don't know how to do this programmatically. Can anyone tell me step by step how to do this through my app?

like image 819
user11 Avatar asked Oct 30 '14 10:10

user11


People also ask

How do I sort folders first in Mac Finder?

On your Mac, click the Finder icon in the Dock to open a Finder window. Do any of the following: Sort items: In any view, choose View > Show View Options, click the Sort By pop-up menu, then choose the sort order, such as Date Modified or Name.

How do you automatically sort folders on a Mac?

1. Click on the View menu in Finder and select Clean up to make all icons align properly. 2. If you want your desktop icons to be auto-arranged, you can do so by clicking on the View menu and then hold on the ALT key on the keyboard until you see the "Keep Arranged By" option show up on the View menu.

How do I put the order of files on a Mac?

Click the desktop, choose View > Sort By, then choose an option. If you want to control the placement of your files on the desktop, keep Sort By set to none. You can still arrange files neatly when desired—just click the desktop, choose View > Clean Up By, then choose how you'd like to arrange the files.

How do you reverse the order of files on a Mac?

in the Finder window click the sort bar at the top again and the content will reverse sorting.


1 Answers

OS X Sierra finally has an option for this:

  • Open Finder
  • Go to Finder Menu -> Preferences
  • Go to "Advanced" tab
  • Check the "Keep folders on top when sorting by name"

Now, When you sort by name, can see folders at top of files (like as windows)

enter image description here

Good Luck ;)

like image 107
Memariaan Avatar answered Sep 24 '22 02:09

Memariaan