​​ ​

The Apple Support Community will permanently close on November 20, 2026. Starting today, the site will no longer accept new posts and is available in a read-only state.


You can continue to find trusted guidance and support on the official Apple Support site. 


We want to thank the community members who have contributed their time and expertise to help others with their Apple products.


AppleScript switch spaces

I can press control-2 to go to space 2, for example. so, i am coding it in AppleScript.

  1. In System Preferences (Exposé & Spaces), set "Enable Spaces"
  2. In System Preferences (Universal Access), set "Enable access for assistive devices"
  3. Go to Space 1 if you are not there already
  4. In AppleScript Editor, paste the following code
    • tell application "System Events"
    • keystroke "2" using {control down}
    • end tell
  5. Click button "Run"


However, the script does not go to space 2 but just beeps. why?

Mac mini, macOS Sierra (10.12.3)

Posted on Mar 15, 2017 7:43 AM

1 reply

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

AppleScript switch spaces

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.