2

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

我将如何使用 AppleScript 将当前选定的 Terminal.app 选项卡的内容复制到粘贴缓冲区?

我可以在命令行上做吗?

整个历史记录呢?

4

1 回答 1

3

要从命令行复制当前选定的 Terminal.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
于 2009-02-10T06:40:13.677 回答