2017-03-16 168 views

回答

1

這應該工作

set the clipboard to "Lsj!" as text 
tell application "iTerm" to activate 
delay 0.1 
tell application "System Events" to tell process "iTerm" 
    keystroke (the clipboard) 
end tell 
1

wch1zpink的答案應該工作。

您如果需要

keystroke "l" using {shift down} -- uppercase 
    keystroke "sj!" -- lowercase 
0

也可以單獨寫出來的文字應工作

tell application "iTerm" to activate 
delay 0.1 
tell application "System Events" to tell process "iTerm" 
key code 37 using {shift down} 
key code 1 
key code 38 
end tell