Skip to content

Instantly share code, notes, and snippets.

@dardo82
Last active February 18, 2016 05:03
Show Gist options
  • Save dardo82/82b9469e23b354af061d to your computer and use it in GitHub Desktop.
Save dardo82/82b9469e23b354af061d to your computer and use it in GitHub Desktop.
Start AirPlay mirroring
on run argv
if (count of argv) is 2 then
set n to item 1 of argv
else
set n to 3
end if
if "stop" is in argv then
set n to 2
end if
tell application "System Events"
tell process "SystemUIServer"
click (menu bar item 1 of menu bar 1 whose description contains "AirPlay")
click menu item n of menu 1 of result
end tell
end tell
end run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment