如何applescript终端。应用在屏幕上复制当前文本?
-
22-08-2019 - |
题
我在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
不隶属于 StackOverflow