Rotate My Left Screen 270°

Hi
I have 3 monitors in my studio. Most of the time all 3 monitors are rotated 0°, but sometimes I need the left monitor to be rotated 270° to display a score that I record. Can I create a macro in KM that will do that?
I don't have that much experience with programming, so I might need a bit of "spelling".
Any help much appreciated!

It is not clear what you mean.

Obviously KM can't physically rotate your screen, but what exactly do you want KM to do? Rotate the windows on that screen?
When you physically rotate the screen, does the macOS not auto-adjust to display windows in the proper upright manner?

A screenshot of both before and after running a KM macro would be very helpful.

Please read:
Tip: How Do I Get The Best Answer in the Shortest Time?

Hi
No the screen doesn't rotate automatically on Mac OS. In System preferences there is a possibility to rotate a connected monitor any degrees you want. I need to rotate the screen 270° and THEN I rotate the monitor myself - it's on an adjustable monitorstand.
So if you imaging a 16:9 monitor, where the menuline normally is located at the top on the long side, then the menu line is now on the short right side of the monitor, and then I rotate the monitor and everything I perfect.
So I need to address the System Preferences/Screen for the leftmost monitor in my set-up.
Hope it's more clear now!

Here is an AppleScript from stackexchange.com that I have NOT tested.
REF: macos - Keyboard shortcut flip screen - Ask Different

Perhaps you can modify it to suit your needs:

property ptyScriptName : "Rotate Display 180º"
property ptyScriptVer : "1.0"
property ptyScriptDate : "2018-03-21"
property ptyScriptAuthor : "user3439894"

(*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PURPOSE:
  • Rotate Display 180º
  
REF:  The following were used in some way in the writing of this script.

  1.  2018-03-21, user3439894, Ask Different
      Keyboard shortcut flip screen
      https://apple.stackexchange.com/a/319961

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*)
if running of application "System Preferences" then
  quit application "System Preferences"
  delay 1
end if

tell application "System Preferences"
  reveal anchor "displaysDisplayTab" of pane id "com.apple.preference.displays"
  delay 1
  tell application "System Events"
    tell pop up button "Rotation:" of tab group 1 of window 1 of application process "System Preferences"
      if (value) contains "Standard" then
        click
        click menu item "180°" of menu 1
        my clickConfirmButton()
      else
        click
        click menu item "Standard" of menu 1
      end if
    end tell
  end tell
  quit
end tell

on clickConfirmButton()
  set wasClicked to false
  repeat until wasClicked
    delay 0.5
    tell application "System Events"
      try
        click button "Confirm" of sheet 1 of window 1 of application process "System Preferences"
        set wasClicked to true
      end try
    end tell
  end repeat
end clickConfirmButton
1 Like

:+1: Thanks! This works a treat…