检索用于在应用程序中打开文档的 Spotlight 查询

发布于 2024-08-27 18:48:04 字数 313 浏览 4 评论 0原文

如果您搜索在 Spotlight 中打开 Preview.app 的内容(例如 PDF 文件),应用程序不仅会打开该文件,而且实际上会将 Spotlight 查询复制到应用程序的搜索字段中(以进行更深入的搜索)。 iPhoto 和 Mail.app 也执行此操作。

这是一个非常好的功能。不幸的是,苹果没有记录它是如何实现的。从 Spotlight 打开文档似乎只是将 application:openFile 发送到应用程序委托。 是否可以以某种方式检索用户的 Spotlight 查询?或者这是 Spotlight 的硬编码功能吗?

If you search for something that opens Preview.app (e.g. a PDF file) in Spotlight, the application not only opens the file but actually copies the Spotlight query into the application's search field (for deeper search). iPhoto and Mail.app also do this.

This is a really nice feature. Unfortunately, Apple does not document how it's implemented. Opening a document from Spotlight appears to simply send application:openFile to the application delegate. Is it possible to retrieve the user's Spotlight query somehow? Or is this a hardcoded feature of Spotlight?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

酒儿 2024-09-03 18:48:04

如果您正在查找查询中使用的术语,keyAESearchText 将起作用(参见清单 10-1)。所以是的,他们记录了它,但不是在预期的地方。在页面底部提交增强请求。

If you're looking for the term used in the query, keyAESearchText will work (see listing 10-1). So yes, they document it, but not in the expected place. File an enhancement request at the bottom of the page.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文