Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Applescript to change osx desktop (spaces) not working

Tags:

I am running osx Sierra, 10.12.4

The following applescript used to trigger a switch to the next desktop space to the right.

tell application "System Events" key code 124 using control down end tell

I can verify that "System Events" is working and will trigger other keyboard commands that affect system processes such as:

tell application "System Events" key code 28 using {control down, command down, option down} end tell

...which will trigger the accessibility setting that turns the screen to inverse colors.

Does anybody have a solution for restoring this functionality in Sierra?

like image 528
LexJacobs Avatar asked Apr 17 '17 03:04

LexJacobs


1 Answers

I changed the shortcut for move right in system preferences/Keyboard/Shortcuts/Mission control.. from ctrl + right arrow to ctrl + 0 (key code 29 using (control down)) and it works now.

enter image description here

tell application "System Events"
    key code 29 using (control down)
end tell
like image 84
wch1zpink Avatar answered Sep 23 '22 10:09

wch1zpink