AppleScript switch spaces
I can press control-2 to go to space 2, for example. so, i am coding it in AppleScript.
- In System Preferences (Exposé & Spaces), set "Enable Spaces"
- In System Preferences (Universal Access), set "Enable access for assistive devices"
- Go to Space 1 if you are not there already
- In AppleScript Editor, paste the following code
- tell application "System Events"
- keystroke "2" using {control down}
- end tell
- Click button "Run"
However, the script does not go to space 2 but just beeps. why?
Mac mini, macOS Sierra (10.12.3)