Noob here,
I want to change my main display using AppleScript. And it didn’t work for me when I try to click “XG27UCS” button in “Displays” window.
I want to click here
to change into xg27ucs settings
But failed
code here
tell application "System Settings"
reveal pane "Displays"
end tell
tell application "System Events" to tell process "System Settings"
tell application process "System Settings" of application "System Events"
click button 2 of scroll area 1 of group 1 of group 2 of splitter group 1 of group 1 of window "Displays"
end tell
tell pop up button "Use as" of group 1 of scroll area 2 of group 1 of group 2 of splitter group 1 of group 1 of window "Displays" of application process "System Settings" of application "System Events"
click
if value is "Main Display" then
click menu item "Mirror for Built-in Display" of menu 1
end if
if value is "Mirror for Built-in Display" then
click menu item "Stop Mirroring" of menu 1
end if
end tell
end tell
and when i try to get actions of this button there seemed to be no action
this is screenshot
button information here
Xcode Accessibility Inspector
I need at least 10 reputation to post images 🙁
many thanks
New contributor
SYSTEM is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.