
Tengo mis preferencias configuradas para CTRL-D
cerrar mi ventana actual, pero me gustaría que la aplicación Terminal se cierre si cierro mi última/única ventana de terminal. iTerm2 puede hacer esto. ¿Puede Terminal hacerlo?
Respuesta1
Abra el editor AppleScript y péguelo.
on is_running(appName)
tell application "System Events" to (name of processes) contains appName
end is_running
set app to "Terminal"
repeat
if is_running(app) then
tell application app
set WindowNum to get window count
if WindowNum = 0 then
quit
end if
end tell
delay 5
end if
end repeat
Luego guarde el script y ejecútelo haciendo doble clic en él.