[Terminal]ターミナルを終了させる
################################
######ターミナルを終了させる
################################
tell application "Terminal"
set numCntWindow to (count of (every window)) as integer
end tell
tell application "Terminal"
set objWindow to (every window)
end tell
repeat with itemWindow in objWindow
tell application "Terminal"
tell itemWindow
set frontmost to true
delay 1
tell application "System Events"
tell process "Terminal"
keystroke "c" using {control down}
keystroke "c" using {control down}
end tell
end tell
end tell
do script "exit" in itemWindow
do script "exit" in itemWindow
end tell
end repeat
delay numCntWindow
tell application "Terminal"
quit saving no
end tell
| 固定リンク
「Terminal」カテゴリの記事
- [Terminal]新規Windowでコマンドを実行するまでの一連の流れ(2025.01.13)
- ターミナル終了(複数Window 複数tab時)(2024.12.30)
- ターミナル終了(単Window時)(2024.12.30)
- ターミナル 実行中のプロセスの終了とウィンドウを閉じる(2024.11.24)
- [Terminal]スクリプト実行後終了したらTerminalも終了する(2024.11.14)