我在 AppleScript 字典中看到当前屏幕的文本值和历史缓冲区都可以作为属性使用。
我如何通过 AppleScript 将当前选定的 Terminal.app 选项卡的内容复制到粘贴缓冲区?
我可以在命令行上执行吗?
整个历史日志怎么样?
最佳答案
从命令行复制当前选定的 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
关于terminal - 如何通过 AppleScript Terminal.app 复制屏幕上的当前文本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/529143/