Der write text
Befehl wird innerhalb der getan current session
, so verwenden Sie das folgende Beispiel Applescript - Code :
activate application "iTerm" tell application "iTerm" tell current session of current window set cmd to "command" write text cmd end tell end tell
Um den keystroke
Befehl zu verwenden, verwenden Sie System Events
:
activate application "iTerm" tell application "iTerm" tell current tab of current window set cmd to "command" tell application "System Events" keystroke cmd keystroke return end tell end tell end tell
Hinweis: Möglicherweise müssen Sie einen delay
Befehl strategisch platzieren, damit iTerm vollständig aktiviert werden kann, bevor die Befehlewrite text
oder ausgeführt werden.keystroke