Can I use a Terminal command to switch to a specific space in OS X 10.6?
Is there any terminal command I can use to switch directly to a space in OS X 10.6 ?
Something like:
spaces switch 2
If you have assigned keyboard shortcuts for switching between Spaces in System Preferences, you can trigger them using AppleScript:
osascript -e 'tell application "System Events" to key code 124 using control down'
This will effectively press Control-Right
. Left
is 123, Up
is 126, and Down
is 125.
These are the key codes for the number keys:
1
18
219
320
421
523
622
726
828
925
029
Just assign an alias to that osascript
call or wrap it in a shell function.