How to get Finder sidebar favorites content cocoa?

前端 未结 3 1905
情深已故
情深已故 2021-01-06 13:06

I need to get paths of objects displayed in Favorites section of Finder Sidebar (for current user). How can I achieve this?

3条回答
  •  粉色の甜心
    2021-01-06 13:36

    There's not a Cocoa API, per se. You would use the LSSharedFileList API. The API is public but the only documentation is the header file, /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSSharedFileList.h. You want the kLSSharedFileListFavoriteItems (and maybe kLSSharedFileListFavoriteVolumes) list type(s).

提交回复
热议问题