• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Get the list of Places in Finder?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Get the list of Places in Finder?


  • Subject: Re: Get the list of Places in Finder?
  • From: Ken Thomases <email@hidden>
  • Date: Thu, 19 Mar 2009 22:40:52 -0500

On Mar 18, 2009, at 1:28 PM, has wrote:

Oleg Krupnov wrote:

I wonder if there is a programmatic way in Cocoa to get the list of
"Places" from the left panel of Finder? (by default populated with
Documents, Desktop, Home, Application, but can be customized with drag
and drop). Thanks!


There's no public API, unfortunately. You could try scraping Finder's preferences file (this info must be stored somewhere, most likely as serialised AliasHandles), or manipulating its GUI via the Accessibility APIs/GUI Scripting. Both would be hacks, however, and prone to breakage, so YMMV.

Actually, the LSSharedFiles API seems to provide this list. Call LSSharedFileListCreate with type kLSSharedFileListFavoriteItems to obtain a reference to that file list. Then, use LSSharedFileListCopySnapshot to obtain the list of files in it.


This API is, as of yet, only (thinly) documented in its header file:
/System/Library/Frameworks/CoreServices.framework/Frameworks/ LaunchServices.framework/Headers/LSSharedFileList.h


Cheers,
Ken

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: Get the list of Places in Finder? (From: has <email@hidden>)

  • Prev by Date: Re: Bound Property
  • Next by Date: Banding/smoothing problem with drawing angled gradients.
  • Previous by thread: Re: Get the list of Places in Finder?
  • Next by thread: Termination Running Applications ...
  • Index(es):
    • Date
    • Thread