检索用于在应用程序中打开文档的 Spotlight 查询
如果您搜索在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您正在查找查询中使用的术语,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.