Try with :
tell application "System Preferences"
name of anchors of pane id "com.apple.preference.universalaccess" --> {"Siri", "Keyboard", "Dwell", "Captioning", "Seeing_VoiceOver", "SpeakableItems", "TextToSpeech", "Hearing", "Switch", "General", "Media_Descriptions", "Mouse", "Seeing_Display", "Virtual_Keyboard", "Seeing_Zoom"} with High Sierra
--> {"Siri", "Seeing_ColorFilters", "Keyboard", "Dwell", "Captioning", "Seeing_VoiceOver", "TextToSpeech", "Hearing", "Dictation", "Alternate_Mouse_Buttons", "General", "Seeing_Cursor", "Media_Descriptions", "Mouse", "Seeing_Display", "Switch", "Seeing_Zoom", "Virtual_Keyboard", "Accessibility_Shortcut"} with Catalina
reveal anchor "Mouse" of pane id "com.apple.preference.universalaccess"
activate
delay 0.1
tell application "System Events"
tell process "System Preferences"
set frontmost to true
-- name of windows --> {"Accessibilité"}
tell window 1
set theClasses to class of UI elements --> {button, button, button, checkbox, static text, button, static text, slider, static text, static text, static text, static text, checkbox, slider, checkbox, scroll area, button, button, button, toolbar} with High Sierra
--> {button, checkbox, scroll area, group, toolbar, button, button, button} with Catalina
if theClasses contains static text then
-- Here with "High Sierra"
title of checkboxes --> {"Activer les touches de souris", "Délai de l’ouverture automatique :", "Afficher l’état d’Accessibilité dans la barre des menus"}
if (value of checkbox 1) = 0 then click checkbox 1 --> "Activer les touches de souris"
else
-- here with "Catalina"
-- class of UI elements of toolbar 1 --> {group, group, group, group}
-- class of UI elements of scroll area 1 --> {table, scroll bar}
-- class of UI elements of group 1 --> {tab}
-- class of UI elements of UI element 1 of group 1 --> {radio button, radio button, static text, slider, static text, static text, static text, static text, checkbox, slider, checkbox, static text, button, button}
-- name of radio buttons of UI element 1 of group 1 --> {"Souris et trackpad", "Autres méthodes de contrôle"}
-- name of radio button 2 of UI element 1 of group 1 --> "Autres méthodes de contrôle"
click radio button 2 of UI element 1 of group 1 --> "Autres méthodes de contrôle"
-- class of UI elements of UI element 1 of group 1--> {radio button, radio button, checkbox, button, static text, checkbox, static text, button}
-- title of checkboxes of UI element 1 of group 1--> {"Activer les touches de souris", "Activer les actions alternatives du pointeur"}
tell UI element 1 of group 1
if (value of checkbox 1) = 0 then click checkbox 1 --> "Activer les touches de souris"
end tell
end if
end tell
end tell -- process
end tell -- System Events
quit
end tell
It’s supposed to work with High Sierra and Catalina. No idea of what it does with Mojave.
Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) vendredi 10 janvier 2020 12:26:37