4

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?

Thecafremo
  • 13,617
  • 3
  • 45
  • 48

2 Answers2

5

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
Lri
  • 105,117
0

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.

Tony Williams
  • 12,142