我在AppleScript词典中看到,当前屏幕的文本价值和历史缓冲区的价值可作为属性提供。

如何将当前选择的终端的内容复制到粘贴缓冲区的内容?

我可以在命令行上做吗?

那整个历史日志呢?

有帮助吗?

解决方案

复制命令行中当前选择的终端的内容:APP:

osascript <<END
  tell application "Terminal"
    tell front window
      set the clipboard to contents of selected tab as text
    end
  end
END

历史:

osascript <<END
  tell application "Terminal"
    tell front window
      set the clipboard to history of selected tab as text
    end
  end
END
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top