![]() Try clicking the Run button a couple times to see if the toggling works.Replace the default script code with what I provide below.Search for "Run AppleScript" and double-click the result.Automator > File > New > Quick Action > Choose.To have a single keyboard shortcut that toggles between 2 resolutions: What works for me in 2022 on macOS 12.1 on MacBook Pro # The next line is optional and could be commented out by prepending with a hash (#). Set selected_button to button "Resolution5, Selected" of UI element 6 of sheet 1Ĭlick button "Resolution1" of UI element 6 of sheet 1Ĭlick button "Resolution5" of UI element 6 of sheet 1 Tell window "Displays" of application process "System Preferences"Ĭlick row monitor of outline 1 of scroll area 1 of sheet 1Ĭlick radio button "Scaled" of radio group 1 of sheet 1 Here is my script which I've added as a Raycast command so that I can trigger from raycast or assign a keyboard shortcut. Imron Gamidli's solution got me the closest to what I wanted with the toggle behavior. Set isScaled to value of radio button "Scaled" of tab group 1Ĭlick radio button "Scaled" of tab group 1Ĭlick radio button 1 of radio group 1 of group 1 of tab group 1Ĭlick radio button "Default for display" of tab group 1 Set isScaled to value of radio button "Scaled" of radio group 1 of group 1Ĭlick radio button "Scaled" of radio group 1 of group 1Ĭlick button 1 of UI element 3 of group 1Ĭlick radio button "Default for display" of radio group 1 of group 1įix on macOS 10.15.4: tell application "System Preferences" ![]() Repeat until (exists radio button "Scaled" of radio group 1 of group 1 of window "Displays") Tell application process "System Preferences" If help of theButton is "2560 × 1440" thenįix on macOS 12.0.1: tell application "System Preferences" Set theButton to (first button of displayOptions whose value of attribute "AXAttributedDescription" contains "Selected") Repeat until (exists UI element 1 of group 1 of scroll area 2 of group 1 of group 2 of splitter group 1 of group 1 of window "Displays") ![]() This switches between the Standard resolution and the "More Space" one ("Mehr Fläche" in German) and should be system language independent.įix for wch1zpink's answer on macOS 13.0.1, thanks to the UI Browser app: do shell script "open x-apple.systempreferences:" Set MoreSpaceRes to button 5 of displayOptions Set StandardRes to button 4 of displayOptions Set displayOptions to UI element 1 of group 1 of scroll area 2 of group 1 of group 2 of splitter group 1 of group 1 Repeat until (exists UI element 1 of group 1 of scroll area 2 of group 1 of group 2 of splitter group 1 of group 1 of window 1) Tell application process "System Settings" ![]() What I use in Ventura 13.2 now: do shell script "open x-apple.systempreferences:" Proposed Fix for Zade's change for the Browser UI System Preferences in 13.0.1, the Shortcut didn't work anymore for me in Ventura 13.2 because of an error around the value of attribute "AXAttributedDescription" part I located that new service I created and assigned it a keyboard shortcutĪfter this, just follow the same procedures to create a new workflow and service for the display resolution lower I saved this file as rez_higher.workflowįrom here, I opened up system preferences/keyboard/shortcuts/services. Once I made sure both scripts work correctly, I then opened up Automator and created a new service for the display resolution higher and added the appropriate script as shown in the following image. This next script is for making the display resolution lower: if my display resolution is not set at the default setting tell application "System Preferences"Ĭlick radio button 3 of radio group 1 of group 1 of tab group 1 Tell application "System Events" to tell process "System Preferences" to tell window "Built-in Retina Display"Ĭlick radio button "Scaled" of radio group 1 of tab group 1Ĭlick radio button 4 of radio group 1 of group 1 of tab group 1 Reveal anchor "displaysDisplayTab" of pane "" This one is for making the display resolution higher: if my display resolution is already at the default position On my system I just enabled both scripts as dictation commands but if you create a new Service through Automator, you can assign keyboard shortcuts to those services.įirst, here are the two scripts I started with. One script for adjusting the display resolution higher and one adjusting display resolution lower. On my system I created two different scripts. Yes you totally can achieve this without running additional apps.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |