我在AppleScript字典中看到当前屏幕的文本值和历史缓冲区可用作属性。
AppleScript如何将当前选定的Terminal.app选项卡的内容复制到粘贴缓冲区?
我可以在命令行上执行此操作吗?
整个历史日志怎么样?
答案 0 :(得分:1)
从命令行复制当前所选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