Jump to content

jacobwtyler

Member
  • Posts

    3
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by jacobwtyler

  1. Holy crap.  That java script is magic.  You guys are amazing!  Thank you for sharing.  The other script in this thread that I said was working suddenly stopped working and was giving me an error about "group 1" so I came back here and gave this javascript a try.  It looks so complicated compared to the other one but worked perfectly!  Really cool stuff.  Wish I could make stuff like that.  

  2. On 11/10/2022 at 3:59 PM, kraig85 said:

    ta-da!!

     

    do shell script "open -b com.apple.systempreferences /System/Library/PreferencePanes/Displays.prefPane"

    use AppleScript version "2.4"

    set iPadName to "iPad Pro"

    tell application "System Events"

              repeat until (exists window "Displays" of application process "System Settings")

                        delay 0.1

              end repeat

              tell process "System Settings"

                        tell pop up button 1 of group 1 of group 2 of splitter group 1 of group 1 of window "Displays"

                                  click

                                  delay 0.1

                                  tell (last menu item of menu 1 whose name contains iPadName)

                                            click it

                                 end tell

                        end tell

              end tell

    end tell

    tell application "System Settings" to quit

    Awesome. This script works on MacOS Sonoma as well. I did have to add a delay of 1 second before the quit system settings at the end because it was closing the settings panel before the display was activated but other than that it works as is. Amazing! 

×
×
  • Create New...