Asumiendo que estoy abriendo una ventana de iTerm con el siguiente AppleScript:
tell application "iTerm"
set win1 to (create window with default profile)
repeat until exists win1
delay 0.01
end repeat
tell current session of current tab of current window
write text "watch -n1 " & "'" & "kubectl get pods | grep -i " & input & "'"
split horizontally with default profile
split vertically with default profile
end tell
¿Qué fragmento de código debo utilizar para que win1
se maximiza (como al hacer clic en el botón verde de la ventana)?
editar En cuanto a la propuesta de solución indicada en la pregunta que se supone duplicada, he modificado mi fragmento de la siguiente manera:
tell application "iTerm"
set win1 to (create window with default profile)
repeat until exists win1
delay 0.01
end repeat
tell application "System Events"
perform action "AXZoomWindow" of (first button whose subrole is "AXFullScreenButton") of (first window whose subrole is "AXStandardWindow") of (first process whose frontmost is true)
end tell
tell current session of current tab of current window
write text "watch -n1 " & "'" & "kubectl get pods | grep -i " & input & "'"
split horizontally with default profile
split vertically with default profile
end tell
Sin embargo, esto abre una nueva ventana de terminal y no se ejecuta ningún otro comando.