Applescript Terminal.appを使用して、画面に現在のテキストをコピーするにはどうすればよいですか?
-
22-08-2019 - |
質問
Applescript Dictionaryでは、現在の画面のテキストと履歴バッファーがプロパティとして利用できることがわかります。
現在選択されている端末の内容をコピーするには、貼り付けバッファーにアプリをコピーするにはどうすればよいですか?
コマンドラインでできますか?
全歴史ログはどうですか?
解決
コマンドラインから現在選択されているターミナルの内容をコピーするには:
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