gpt4 book ai didi

macos - 将项目添加到 Finder 侧边栏

转载 作者:行者123 更新时间:2023-12-03 16:08:40 27 4
gpt4 key购买 nike

我想向 Finder 侧边栏添加一个新项目。我发现 Finder 将“地点”列表保存在 `~/Library/Preferences/com.apple.sidebarlists.plist 中。我能够使用 Carbon API 读取该文件,并看到每个项目都有名称、图标和别名。

使用第三方应用程序(例如 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。

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

关于macos - 将项目添加到 Finder 侧边栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4852516/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com