Switch spaces with apple script My goal is to switch spaces from within an apple script. My shortcut to switch to the 4th space is ctrl+4, but when I tried this in an apple script nothing happens:

tell application "System Events"
    keystroke "4" using {control down}
end tell


What am I doing wrong?
I do not know why, but using key code instead works

tell application "System Events"
    tell application "System Events" to key code 21 using control down
end tell