Keyboard airplay shortcut
I want to enable or disable the airplay at Mountain Lion on the keyboard via a shortcut. Is there a way to do this? Thank you
I want to enable or disable the airplay at Mountain Lion on the keyboard via a shortcut. Is there a way to do this? Thank you
If I understand your request correctly which I believe is that you want to enable/disable airplay mirroring with a quick keyboard shortcut. Then I suggest you do the following, bit techy but its easy to do.
tell application "System Preferences"
set current pane to pane "com.apple.preference.displays"
activate
end tell
tell application "System Events"
tell process "System Preferences"
click pop up button 1 of window 1
click menu item 2 of menu 1 of pop up button 1 of window 1
end tell
end tell
tell application "System Preferences"
delay 10
quit
end tell
Hopefully you ended up with something like this:
By the way if you want to create another script to Disable airplay mirroring. It is also easy, just change the following line:
clickmenu item 2 of menu 1 of pop up button 1 of window 1
With this:
clickmenu item 1 of menu 1 of pop up button 1 of window 1
If I understand your request correctly which I believe is that you want to enable/disable airplay mirroring with a quick keyboard shortcut. Then I suggest you do the following, bit techy but its easy to do.
tell application "System Preferences"
set current pane to pane "com.apple.preference.displays"
activate
end tell
tell application "System Events"
tell process "System Preferences"
click pop up button 1 of window 1
click menu item 2 of menu 1 of pop up button 1 of window 1
end tell
end tell
tell application "System Preferences"
delay 10
quit
end tell
Hopefully you ended up with something like this:
By the way if you want to create another script to Disable airplay mirroring. It is also easy, just change the following line:
clickmenu item 2 of menu 1 of pop up button 1 of window 1
With this:
clickmenu item 1 of menu 1 of pop up button 1 of window 1
Hi All,
I have been using my first iMac for about three days and loving it!
I was investigating this same question... with mixed success. I was able to create three shortcuts to make AirPlay work:
1. Shortcut to System Pref
2. Shortcut to Display
3. Shortcut to Airplay Device
I also created a fourth shortcut to turn AirPlay off in the display settings.
This works fairly well, but three shortcuts is a bit disappointing, does anyone have any tips to combine these into a single shortcut?
This works in Mavericks as well, but I had to change this line:
click menu item 2 of menu 1 of pop up button 1 of window 1
to
click menu item 3 of menu 1 of pop up button 1 of window 1
Good luck. I'm wondering if this could be simpler by calling the menu item for choosing Airplay.
I'm having issues with this on Mavericks where it requires whichever app is active at the time of hitting the keyboard shortcut to have been granted permission to control the computer.
This means each time I hit the keys in a new app, I need to go to System Preferences -> Security & Privacy -> Privacy -> Accessibility and then grant the app permission.
Does anyone know any solution to this, other than adding every single app to the list (which you can't do without it first trying and failing for that app, it seems).
I solved your problem by using BetterTouchTool and where you can trigger a workflow (you find it under "Controlling Other Applications" in the "Trigger Predefined Action" drop down menu) with a keyboard shortcut (fn f12 for example) and not giving it a keyboard shortcut in the Keyboard shortcut pane in System Preferences.
I have written an apple script which toggles between airplay speakers and regular speakers:
tell application "System Events"
tell process "SystemUIServer"
key down option
click menu bar item 4 of menu bar 1
key up option
set v to value of attribute "AXMenuItemMarkChar" of menu item 2 of menu 1 of menu bar item 4 of menu bar 1 as string
if (v is equal to "✓") then
click menu item 3 of menu 1 of menu bar item 4 of menu bar 1
else
click menu item 2 of menu 1 of menu bar item 4 of menu bar 1
end if
end tell
end tell
And as I wrote earlier:
Instead of giving it a keyboard shortcut in the Keyboard shortcut pane in System Preferences, using BetterTouchTool you can trigger a workflow (you find it under "Controlling Other Applications" in the "Trigger Predefined Action" drop down menu) with a keyboard shortcut (fn f12 for example). This avoids the problem Luke Noel-Storr described.
(Otherwise just handle the applescript following lPlacids instructions(exept the part involving the Preference Pane if you are using BetterTouchTool naturaly))
Brilliant! Awesome tip. Thanks!
Awesome , lplacid!
Is there any way to do this in iTunes for AirPlay? If I just want to make a shortcut for AirPlaying within iTunes.
Hello Iplacid,
The applescript works but it refuse to continue. I have to click on continue to run it and i need another command key for that.
Dandeman12
src="http://i906.photobucket.com/albums/ac264/Dandeman12/Sanstitre_zps110a3fdb.png" border="0" alt=" photo Sanstitre_zps110a3fdb.png"/></a>
Keyboard airplay shortcut