MacGeeky Posted May 2, 2013 Share Posted May 2, 2013 (edited) This workflow let you activate and deactivate AirPlay Mirroring from Mac to Apple TV via Alfred. The user can choose between keyboard shortcuts or keywords to activate/deactivate AirPlay Mirroring. Keywords: AirPlay On = 'air on' AirPlay Off = 'air off' AirPlay Audio on = 'audio on' (new feature) Internal Speakers = 'audio off' (new feature) USB Speakers = 'audio usb' Download AirPlay Mirroring On/Off 1.0 Download AirPlay On/Off 1.1 Download AirPlay On/Off 1.11 Download AirPlay On/Off 1.12 Download AirPlay On/Off 1.13 Download AirPlay On/Off 1.14 Download AirPlay Mirroring On/Off v1.15 Download AirPlay On/Off 1.2 Dependencies: Add Alfred in System Preferences => Accessibility and Security => Privacy (tab) => Accessability (remember to unlock the hanglock in the lower left part of the window to be able to add applications). Mac with support for AirPlay Mirroring Apple TV on the same network Make sure the (network) name of the Apple TV is "Apple TV". If not, look for solutions at the end of this post. If you see the AirPlay icon in the menu bar, you're good to go If your Apple TV's name's not "Apple TV" - you can make the workflow work by using one of these methods: Change the name of your Apple TV Change the script - find the following line of code (line 3), and change "Apple TV" to the name of your Apple TV: set valg to "Apple TV" ----------------------------------------------------- ** UPDATES ** ------------------------------------------------- UPDATE 1.10 - new name: "AirPlay On/Off" Changes in version 1.10: It's now possible to also switch the AirPlay Audio on/off, but also to switch to USB speakers. Update 1.11 - Changes: Added possibility to use USB audio device as output - keyword: 'audio usb' I've also made it easier for the users to add their own device - just remove (* and *) in the bottom part of the code. Then you'll add the keyword you want to use, and the name of the audio device as explained in the screenshot below. Update 1.12 - Changes: New option: reset 'coreaudiod' process (useful when system audio or airplay isn't working like it should). How to reset 'coreaudiod' process: Add your own keyboard shortcut in the preferences, or use the keyword "resetair" Update 1.13 - Changes: - Bug fixes - Better support for multiple AirPlay Audio devices... Download AirPlay On/Off v1.13 Update 1.2 - Changes: - ready for Yosemite - bug fixes Edited October 31, 2014 by MacGeeky Link to comment
MacGeeky Posted May 2, 2013 Author Share Posted May 2, 2013 (edited) Update: AirPlay On/Off 1.11 - Added possibility to use USB audio device as output - keyword: 'audio usb' - Easier to add your own device (uncomment some code, and name the keyword) Edited May 11, 2013 by MacGeeky Link to comment
MacGeeky Posted May 11, 2013 Author Share Posted May 11, 2013 (edited) New update: AirPlay On/Off 1.12 Changes: New option: reset 'coreaudiod' process (useful when system audio or airplay isn't working like it should). How to reset coreaudiod process: Add your own keyboard shortcut in the preferences, or use the keyword "resetair" Edited May 11, 2013 by MacGeeky Link to comment
astrism Posted June 11, 2013 Share Posted June 11, 2013 Thanks for the awesome plugin MacGeeky. I had never noticed the sound settings in System Preferences which allow you to select your apple tv for audio output. I tried to do this with your Workflow, I can turn off the audio, but I can't turn it on. Assuming it has do with the "Apple TV" name which has spaces? I tried: audio Apple TV audio "Apple TV" audio on Any other ideas? Link to comment
MacGeeky Posted June 12, 2013 Author Share Posted June 12, 2013 (edited) Thanks for the awesome plugin MacGeeky. I had never noticed the sound settings in System Preferences which allow you to select your apple tv for audio output. I tried to do this with your Workflow, I can turn off the audio, but I can't turn it on. Assuming it has do with the "Apple TV" name which has spaces? I tried: audio Apple TV audio "Apple TV" audio on Any other ideas? Hi, try to install this version instead... http://cl.ly/Pdex Please tell me if this works for you or not Use 'Audio on' Edited June 13, 2013 by MacGeeky Link to comment
MacGeeky Posted June 13, 2013 Author Share Posted June 13, 2013 (edited) New update: better support for multiple AirPlay audio devices, and some bug fixes.Download AirPlay Mirroring On/Off v1.13 Edited June 13, 2013 by MacGeeky Link to comment
MacGeeky Posted June 15, 2013 Author Share Posted June 15, 2013 (edited) New Update - AirPlay On/Off 1.14: fixed a bug and added support for multiple AirPlay Devices in both AirPlay Mirroring and AirPlay Audio. Download Edited June 15, 2013 by MacGeeky Link to comment
astrism Posted June 19, 2013 Share Posted June 19, 2013 Unfortunately they didn't seem to help. I should have mentioned this but I'm on 10.9 (Mavericks), but I do have the Accessibility settings enabled if that matters. Anything else I could tell you? Link to comment
streetdaddy Posted December 4, 2013 Share Posted December 4, 2013 This workflow doesn't give me the option to enter the 4 digit confirmation code that's displayed on the Apple TV device. Link to comment
maskedjellybean Posted June 20, 2014 Share Posted June 20, 2014 (edited) Thanks for the workflow, it's super handy! I wanted to post this in case anyone else has a similar issue. When using keyword 'air on' I was being given a prompt to 'Choose Device' and a choice between my Apple TV as well as "msng". I have no idea what msng is, it does not appear in my options when manually turning on Airplay. But I was able to remove it and avoid the extra prompt by modifying the top Applescript in the workflow like this: (I'm on 10.9 Mavericks if that's helpful) set enheter to name of menu items of menu 1 of pop up button 1 of window 1 as list set enheter2 to items 2 thru (number of items in enheter) of enheter -- Beginning of custom code - Remove mysterious msng option set itemsToDelete to {"msng"} set cleanList to {} repeat with i from 1 to count enheter2 if {enheter2's item i} is not in itemsToDelete then set cleanList's end to enheter2's item i end repeat set enheter to cleanList set enheter2 to cleanList Edited June 20, 2014 by maskedjellybean Link to comment
MacGeeky Posted October 12, 2014 Author Share Posted October 12, 2014 Thanks for the update 'maskedjellybean' Haven't checked my notifications in this forum for while, didn't know about the bug/problem - thanks again! Link to comment
jason588 Posted October 24, 2014 Share Posted October 24, 2014 Thank you Mac, this is a fantastic workflow!! Unfortunately I can't seem to get it to work on Yosemite. Is this broken as of Yosemite? Also getting the msng selection but maskedjellybean's solution seems to work (unfortunately I get the same non-functioning error with and without the custom code) Link to comment
MrXoom2000 Posted October 28, 2014 Share Posted October 28, 2014 Thank you Mac, this is a fantastic workflow!! Unfortunately I can't seem to get it to work on Yosemite. Is this broken as of Yosemite? Also getting the msng selection but maskedjellybean's solution seems to work (unfortunately I get the same non-functioning error with and without the custom code) Yes, same here. No function. Get the list wit my Apple TV and a msng entry. If i select the Apple TV, Airplay start, but i have a black screen on the TV. If i start Airplay mirroring manualy everything is fine and works. how could help ? Link to comment
MacGeeky Posted October 29, 2014 Author Share Posted October 29, 2014 (edited) It´s actually working fine on my Mac with Yosemite, but had to implement the code from @maskedjellybean to get rid of the msng-error. What happens when you use the extension? Nothing at all, or does it just stop somewhere in the process? And last - is Alfred added in the list here: System Preferences => Accessibility and Security => Privacy (tab) => Accessability? If not, please add Alfred and see if that makes any difference. That´s probably the one and only reason people are having problems with this extension on Yosemite! Edited October 31, 2014 by MacGeeky Link to comment
MacGeeky Posted October 29, 2014 Author Share Posted October 29, 2014 New update: Implemented @maskedjellybean´s bug-fix for ´msng´ in device list... A big thank you to maskedjellybean! Download AirPlay Mirroring On/Off v1.15 If you´re experiencing problems with this extension after the upgrade to Yosemite - please give me som info about it. As soon as I get a little information I´ll get on with the bug fix. Link to comment
jason588 Posted October 30, 2014 Share Posted October 30, 2014 The latest update seems to have successfully removed the msng message I received before, same as adding the custom code did. But it's still not working on yosemite for me (unfortunately I just discovered this workflow so didn't have a chance to test if it worked prior to the upgrade). I'm using the latest 2013 macbook pro retina. Best I can describe on activating the workflow is it pulls up display, shuffles a bit with the menu and clear selects "Apple TV", but then nothing happens. Maybe the delay is too short and somehow canceling the menu before it has time to fully implement? Link to comment
MacGeeky Posted October 31, 2014 Author Share Posted October 31, 2014 (edited) @Jason588 or anyone else - could you please test this version for me? http://cl.ly/YJES I finally replicated the bug on my Mac after a clean install of Yosemite, and removed it. It should be gone on any Mac running Yosemite, but I have to get it confirmed from other users before I post this version as an "official" update Maybe the delay is too short and somehow canceling the menu before it has time to fully implement? You were absolutely right, thanks! Edited October 31, 2014 by MacGeeky Link to comment
jason588 Posted October 31, 2014 Share Posted October 31, 2014 Success! The delay actually can feel quite a bit long (sometimes) when turning airplay on, but it works like a charm. Turning airplay off is totally seamless. Thanks Mac. Really a terrific workflow and script. MacGeeky 1 Link to comment
MacGeeky Posted October 31, 2014 Author Share Posted October 31, 2014 Finally! Thanks for the help getting there! Link to comment
MrXoom2000 Posted November 4, 2014 Share Posted November 4, 2014 Finally! Thanks for the help getting there! Settings app start, and the drop down for changing the Airplay device open. But nothing happens. I need to select the Apple TV by myself. Air Off also did´t work for me. Link to comment
dfay Posted November 10, 2014 Share Posted November 10, 2014 How random. I had never looked at this workflow before but decided to check it out tonight to listen to a recording of Baroque organ by an organist who happens to be the organist at Trondheim Cathedral. Link to comment
mikedvzo Posted February 27, 2015 Share Posted February 27, 2015 I have two Apple TV and I set the value to Apple TV2 and I still get a popup window with 3 entries: msg, Apple TV1, Apple TV2. If I select one of of the apple TV's is stil odes not work. I looked at your code and wee you are trying to strip out msg. Any ideas? Link to comment
jacg Posted January 28, 2016 Share Posted January 28, 2016 Hi, Does anyone know how I modify this to start Airplay with my default settings which is 'Use as a separate display', not mirroring? Thanks, John Link to comment
jacg Posted January 28, 2016 Share Posted January 28, 2016 (edited) Ok, I pasted some code in from another website and have done it now. But I can't close the system preferences. It looks easy but I can't make it happen. Edited January 29, 2016 by jacg Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now