화면의 현재 텍스트를 복사하려면 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