Sample Header Ad - 728x90

AppleScript Not Selecting Button in System Settings

1 vote
0 answers
31 views
I'm trying to write an AppleScript that selects "Shuffle All" and toggles "Show on all Spaces" in the Wallpaper preference pane in System Settings (see screenshot). However, the command to click on the button "Shuffle All" doesn't seem to work. enter image description here Here's the AppleScript -- Open System Preferences tell application "System Settings" activate delay 1 set current pane to pane id "com.apple.Wallpaper-Settings.extension" end tell -- Wait for the Wallpaper pane to load delay 1 tell application "System Events" tell process "System Settings" click button 1 of UI element 1 of scroll area 6 of UI element 1 of scroll area 2 of group 1 of group 2 of splitter group 1 of group 1 of window "Wallpaper" set theCheckbox to checkbox "Show on all Spaces" of group 2 of scroll area 1 of group 1 of group 2 of splitter group 1 of group 1 of window "Wallpaper" tell theCheckbox if not true then click theCheckbox end tell end tell end tell I believe the UI element is correct. I ran entire contents of window 1 and it seems clear that "Shuffle All" is indeed button 1 of UI element 1 of scroll area 6 of UI element 1 of scroll area 2 of group 1 of group 2 of splitter group 1 of group 1 of window "Wallpaper". Why the command to click the button doesn't do anything is a mystery to me, though. Any help is greatly appreciated.
Asked by Xehelios (11 rep)
Jul 19, 2024, 04:25 PM