I use for movements to the left the script
tell application "System Events" to keystroke (ASCII character 28) using command down
to switch to the workplace to the left. To the right use ASCII char 29. Be sure to set the thresholds right for the motion detection, else it drives you crazy...