I want to perform two keystrokes in AppleScript, successively. The script should perform Command+Shift+J and after that Command+W in the application Google Chrome.
Can this be done with AppleScript?
Ask Different is a question and answer site for power users of Apple hardware and software. It only takes a minute to sign up.
Sign up to join this communityI want to perform two keystrokes in AppleScript, successively. The script should perform Command+Shift+J and after that Command+W in the application Google Chrome.
Can this be done with AppleScript?
Try using a script like this:
activate application "Google Chrome"
tell application "System Events"
keystroke "j" using {shift down, command down}
delay 1
keystroke "w" using command down
delay 1
end tell
repeat
, even without n times
? I had to kill applications because of the infinite repeat
. :(
– Sanghyun Lee
Dec 28 '16 at 20:41