[ad_1]
I’m attempting to vary my MacBook Professional 14″s scale setting through AppleScript.
The setting ought to toggle two decision settings.
I discovered the next script right here: https://stackoverflow.com/a/62664159/15705553
on run {enter, parameters}
inform utility "System Preferences"
reveal anchor "displaysDisplayTab" of pane "com.apple.desire.shows"
finish inform
set lowResolutionSettingIndex to 4
set highResolutionSettingIndex to five
inform utility "System Occasions" to inform course of "System Preferences" to inform window "Constructed-in Retina Show"
click on radio button "Show" of tab group 1
click on radio button "Scaled" of tab group 1
inform radio group 1 of group 1 of tab group 1
set isHighResolutionSet to get worth of radio button highResolutionSettingIndex
finish inform
if isHighResolutionSet then
-- Toggle native decision
click on radio button lowResolutionSettingIndex of radio group 1 of group 1 of tab group 1
else
-- Toggle Default setting - "Retina optimized"
click on radio button highResolutionSettingIndex of radio group 1 of group 1 of tab group 1
finish if
finish inform
give up utility "System Preferences"
return enter
finish run
I modified “Constructed-in Retina show” to “Constructed-in Liquid Retina XDR Show” as proven in my System Preferences, however two errors happen:
- If I execute this script by Automator, I get the next error:
Syntax Error: System Occasions bought an error: Can’t get window "Constructed-in Liquid Retina XDR Show" of course of "System Preferences".
- If I execute it by shortcuts.app, I get the next error, despite the fact that I granted entry to accessibility options for Shortcuts in System Preferences
System Occasions bought an error: Shortcuts just isn't allowed assistive entry.
[ad_2]
