Reputation: 81
tell application "iTerm" to activate
delay 0.1
tell application "System Events" to tell process "iTerm"
keystroke "Lsj!"
end tell
I want know how can i get the right way to enter some character. keystroke command can't identify case.
Upvotes: 1
Views: 310
Reputation: 47
That should work
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
Upvotes: 0
Reputation: 4581
wch1zpink's answer should work.
You can also write out the letters individually if needed
keystroke "l" using {shift down} -- uppercase
keystroke "sj!" -- lowercase
Upvotes: 1
Reputation: 3142
This should work
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
Upvotes: 1