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 protected])
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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]