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?
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?
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
Yes, you need to script the System Events application.
There is a good start here
There is a good detailed answer here with lots of required details.
repeat, even withoutn times? I had to kill applications because of the infiniterepeat. :( – Sanghyun Lee Dec 28 '16 at 20:41repeat. – Sanghyun Lee Dec 28 '16 at 20:46