Untitled

mail@pastecode.io avatar
unknown
fortran
2 months ago
749 B
1
Indexable
Never
tell application "System Events"
    tell process "ControlCenter"
        set controlCenterButton to (first menu bar item of menu bar 1 whose description contains "control center")
        click controlCenterButton
        delay 2 -- Adjust delay as necessary
        
        set screenMirroringButton to (first button of group 1 of window "Control Center" whose description contains "Screen Mirroring")
        click screenMirroringButton
        delay 2 -- Adjust delay as necessary
        
        -- Replace 'Living Room TV' with the name of your Apple TV
        set airPlayDeviceButton to (first button of scroll area 1 of window "Control Center" whose name contains "Living Room TV")
        click airPlayDeviceButton
    end tell
end tell
Leave a Comment