Rotate Monitor 90º

#1

New to Better Touch Tool. Sorry if this is a dumb question. Is there a way to set a command to automatically rotate my monitor? I have monitor on an arm and at least once a day I switch the orientation of the monitor (portrait vs landscape). I then have to go into system preferences and change it. Hoping for a faster way.

0 Likes

#2

An UI apple script could do this quite easily.

0 Likes

#3

Thanks. I don't know how to do that. Can you point me to some resources to help me learn how?

0 Likes

#4

If it's fine for you to wait 10d I can do it afterwards.
Here is some UI scripting from the settings app from my preset:

try
	tell application "System Preferences"
		set current pane to pane "com.apple.preference.trackpad"
	end tell
	
	tell application "System Events"
		tell process "System Preferences"
			click radio button "Scroll & Zoom" of tab group 1 of window "Trackpad"
			click checkbox 2 of tab group 1 of window "Trackpad"
			click checkbox 3 of tab group 1 of window "Trackpad"
			click checkbox 2 of tab group 1 of window "Trackpad"
			click checkbox 3 of tab group 1 of window "Trackpad"
		end tell
	end tell
	tell application "System Preferences"
		quit
	end tell
end try

The pane should be com.apple.preference.screens, but as you have to open it up with the ⌘⌥ keys clicked it could be easier to do something

tell process "System Preferences"
tell window thisDisplay
tell tab group 1
click radio button "Display" 

No clue :man_shrugging:t2: Try to find sth by your self, you'll also have to discover the name of the menu to be enrolled, I'll look into this after my exams :ok_hand:t3:

Even easier would be a simple command line, but I didn't find a native way to do this on macOS, only third party tools.

0 Likes