How to get Finder sidebar favorites content cocoa?

前端 未结 3 1919
情深已故
情深已故 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:15

    Use LSSharedFileList API(LaunchServices/LSSharedFileList.h.)

     LSSharedFileListRef favoriteItems = LSSharedFileListCreate(NULL,
                                                                kLSSharedFileListFavoriteItems, NULL);
    

提交回复
热议问题