首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >How can I AppleScript Terminal.app to copy the current text on the screen?

How can I AppleScript Terminal.app to copy the current text on the screen?
EN

Stack Overflow用户
提问于 2009-02-09 17:48:33
回答 1查看 3.9K关注 0票数 2

我在AppleScript字典中看到,当前屏幕上的文本和历史记录缓冲区可以作为属性使用。

如何将当前选择的Terminal.app选项卡中的内容复制到粘贴缓冲区?

我可以在命令行上做吗?

那整个历史记录呢?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2009-02-10 06:40:14

从命令行复制当前选定Terminal.app的内容:

代码语言:javascript
复制
osascript <<END
  tell application "Terminal"
    tell front window
      set the clipboard to contents of selected tab as text
    end
  end
END

对于历史:

代码语言:javascript
复制
osascript <<END
  tell application "Terminal"
    tell front window
      set the clipboard to history of selected tab as text
    end
  end
END
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/529143

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档