macos – 将项添加到Finder侧栏

macos – 将项添加到Finder侧栏,第1张

概述我想在Finder侧边栏中添加一个新项目.我发现Finder将“地点”列表保存在`〜/ Library / Preferences / com.apple.sidebarlists.plist中.我能够使用Carbon API读取文件,并看到每个项目都有Name,icon和别名. 使用第三方应用程序,如PlistEdit Pro,我能够更新别名.我的问题是如何使用Carbon API更新别名.无法 我想在Finder侧边栏中添加一个新项目.我发现Finder将“地点”列表保存在`〜/ library / Preferences / com.apple.sIDebarLists.pList中.我能够使用Carbon API读取文件,并看到每个项目都有name,icon和别名.

使用第三方应用程序,如PListEdit Pro,我能够更新别名.我的问题是如何使用Carbon API更新别名.无法找到创建将在Finder中打开的别名的方法.似乎DropBox和PListEditor Pro都能找到方法.

解决方法 看看 here:

The Shared file List API is new to
Launch Services in Mac OS X Leopard.
This API provIDes access to several
kinds of system-global and per-user
persistent Lists of file system
objects,such as recent documents and
applications,favorites,and login
items. For details,see the new
interface file LSSharedfileList.h.

您想要查找键kLSSharedfileListFavoriteItems,它处理补充工具栏中“位置”下的项目.
我想你可以尝试做类似于this的事情,使用LSSharedfileListCreate来创建kLSSharedfileListFavoriteItems.

或者您可以使用here发布的Applecript,这将更容易,但不是“正确的方式”©

总结

以上是内存溢出为你收集整理的macos – 将项添加到Finder侧栏全部内容,希望文章能够帮你解决macos – 将项添加到Finder侧栏所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1018309.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-23
下一篇 2022-05-23

发表评论

登录后才能评论

评论列表(0条)

保存