tell application "iTerm" to activate
delay 0.1
tell application "System Events" to tell process "iTerm"
keystroke "Lsj!"
end tell
我想知道如何才能正確地輸入某些字符。 keystroke命令無法識別大小寫。AppleScript中的keystroke命令無法識別案例
tell application "iTerm" to activate
delay 0.1
tell application "System Events" to tell process "iTerm"
keystroke "Lsj!"
end tell
我想知道如何才能正確地輸入某些字符。 keystroke命令無法識別大小寫。AppleScript中的keystroke命令無法識別案例
這應該工作
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
wch1zpink的答案應該工作。
您如果需要
keystroke "l" using {shift down} -- uppercase
keystroke "sj!" -- lowercase
也可以單獨寫出來的文字應工作
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