OS X 获取突出显示的文本
我有兴趣为 OS X 编写一个插件,以支持右键单击上下文菜单中突出显示的文本的多种操作。 操作很简单,我可以自己写。 我已经研究过自动化程序的“复制到剪贴板”操作,但它首先需要一些文本输入。 “获取剪贴板的内容”操作将使我的操作需要首先将突出显示的文本复制到剪贴板。
所以问题很简单:如何访问系统范围的突出显示文本缓冲区? 或者这是严格禁止的?
谢谢!
I'm interested in writing a plugin for OS X to support multiple operations on highlighted text in the right click context menu. The operations are simple enough that I could write them by myself. I've looked at automator's "Copy to Clipboard" action, but it requires some text input first. The "Get contents of Clipboard" action will make my operations require the highlighted text to first be copied to the clipboard.
So the question is simple: how do I access the system wide highlighted text buffer? Or is this strictly off limits?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不存在“系统范围内突出显示的文本缓冲区”这样的东西; 仅选择文本不会将其移动到剪贴板等中心位置。 由于您可以同时在多个窗口中选择文本,因此还不清楚这会做什么。
您是否考虑过使用服务菜单? 它专门设计用于允许第三方应用程序为用户提供对所选文本执行的操作。
There's no such thing as "the system wide highlighted text buffer"; just selecting text doesn't move it to a central location like the clipboard. And since you can have text selected in multiple windows at once, it's not really clear what that would even do.
Have you considered using the services menu? It's specifically designed to allow third party apps to provide operations for users to perform on selected text.