OliverJAsh Posted May 27, 2013 Share Posted May 27, 2013 iTunes was recently updated to allow control of AirPlay video AppleScript. I was wondering if someone could make a workflow for it? Here's a small example script: tell application "iTunes" set apNames to (get name of AirPlay devices) set apDevices to (get AirPlay devices) set rez to choose from list apNames with prompt "Select Airplay:" with multiple selections allowed if rez is false then return set apPlays to {} repeat with i from 1 to length of apNames if item i of apNames is in rez then set end of apPlays to item i of apDevices end repeat set current AirPlay devices to apPlays end tell Link to comment
smirky Posted June 23, 2013 Share Posted June 23, 2013 I've been wanting to throw something like this together for a while. How does this work for you? direct link. Hotkey pops up a list of Airplay devices used by iTunes. Select one to toggle it on/off. Link to comment
OliverJAsh Posted June 29, 2013 Author Share Posted June 29, 2013 Perfect. Thank you! Link to comment
smirky Posted September 22, 2013 Share Posted September 22, 2013 In case anyone else is using this workflow: I had to make a couple small changes to the script because the iTunes 11.1 update seems to have broken the original. The previous link goes to the revised version, but here they are again: direct link Github DJay 1 Link to comment
DJay Posted September 23, 2013 Share Posted September 23, 2013 (edited) Thanks a lot. Don't want to miss this workflow. Really appreciate. Edited September 23, 2013 by DJay Link to comment
smirky Posted January 27, 2014 Share Posted January 27, 2014 I thought I'd post an update to let anyone following this thread know: I uploaded the most recent version of this workflow to the new Packal site, here. It sounds like there will be a great feature over there to keep track of updated workflows so you may want to keep an eye out. There have not been any updates since September so you won't miss anything if you don't grab the version over there. Link to comment
smirky Posted April 7, 2014 Share Posted April 7, 2014 Just a minor update to this workflow: It seems like the Airplay device results were not being ordered properly (possibly due to tiny a change in Alfred after the 2.2 update). I pushed a 1.01 update to Packal; you can grab the new version there. Link to comment
dfay Posted March 8, 2015 Share Posted March 8, 2015 Thanks for this. I've added a couple Remote Triggers - you set up a trigger with the Argument type Text and the string as the name of the desired Airplay device, then pipe it out to the existing script in the workflow. Works great. Link to comment
smirky Posted March 8, 2015 Share Posted March 8, 2015 Thanks for this. I've added a couple Remote Triggers - you set up a trigger with the Argument type Text and the string as the name of the desired Airplay device, then pipe it out to the existing script in the workflow. Works great. That's a great idea. I was waiting patiently for the day when maybe the remote app is able to auto-populate triggers within itself, but if this is fairly easy I could add a few blank triggers to the workflow and provide examples for anyone that wants them. I'll probably mess around today and add that as a minor update. Link to comment
myrison Posted October 6, 2015 Share Posted October 6, 2015 Smirky - awesome app and thank you for posting it. One wish list item for you to consider if you get back to working on this app: Would it be possible to edit your script to allow multiple devices to be selected as opposed to just one at a time? I sometimes want to pipe music to several rooms in my house at once and this would be a great addition.And then one tip for anyone else trying to automate some of this via remote. The first way I did it was to add a remote page that triggers this workflow, and then a series of other "Dispatch Key Combo" buttons that send the CMD 1, CMD 2, CMD 3, etc. shortcuts that each select one of the AirPlay devices in my house. This allows you to automated doing it remotely, though it's still only selecting one speaker at a time for now. Thanks again, great script! Link to comment
mlondon Posted April 9, 2020 Share Posted April 9, 2020 (edited) Does this workflow still work? I entered a hotkey, but "iTunes Airplay Toggle" flashes in the Alfred search bar and disappears. Am I doing something wrong? I just need a way to select various AirPlay speakers. Is there a better way? Edited April 9, 2020 by mlondon Link to comment
smirky Posted April 11, 2020 Share Posted April 11, 2020 On 4/9/2020 at 9:26 AM, mlondon said: Does this workflow still work? Hi, yes! I still maintain this workflow as regularly as possible via the github page linked below. The current version works with Catalina but you can grab an older version if you haven't upgraded yet. Let me know if you're having any trouble with the current version and I'll help fix anything needed. https://github.com/dotson/iTunes-Airplay-Toggle Link to comment
godbout Posted April 13, 2020 Share Posted April 13, 2020 ahhh i've removed that workflow a few months ago because it didn't work with Catalina. i'm seeing there's an update only now 😂️ thanks a lot. very useful! Link to comment
mlondon Posted April 20, 2020 Share Posted April 20, 2020 On 4/10/2020 at 9:39 PM, smirky said: Hi, yes! I still maintain this workflow as regularly as possible via the github page linked below. The current version works with Catalina but you can grab an older version if you haven't upgraded yet. Let me know if you're having any trouble with the current version and I'll help fix anything needed. Hi, Got it working on Mojave, thank you. However I see that the workflow just toggles each Airplay target on/off. I would like to be able to SWITCH from one to another. For example, iTunes is set to play to Computer. Using your workflow, I have to toggle Computer OFF, and then toggle my speakers ON. Is there a way to SWITCH instead of the current behaviour? Thanks again... Link to comment
smirky Posted April 20, 2020 Share Posted April 20, 2020 6 hours ago, mlondon said: Hi, Got it working on Mojave, thank you. However I see that the workflow just toggles each Airplay target on/off. I would like to be able to SWITCH from one to another. For example, iTunes is set to play to Computer. Using your workflow, I have to toggle Computer OFF, and then toggle my speakers ON. Is there a way to SWITCH instead of the current behaviour? Thanks again... Thanks for the update, glad to hear that it's working for you! That feature should be fairly simple to implement and there are a couple ways to go about doing it. One is to allow a key option such that using it would toggle all choices rather than the one specifically chosen (i.e., action using shift-enter to make this one active and the others inactive). This would allow both the existing function and additional function to exist all at once. Another would be to let the user set which is the default type of action (i.e., set the variable in the preferences). I think it'd be possible to do both at once, so you could tell Alfred which choice is your preferred default ('individual toggle' or 'switch to') and then have the other option be chosen with the special key combo. I'm going to play around a bit and see if I can make that work. Link to comment
smirky Posted May 4, 2020 Share Posted May 4, 2020 On 4/20/2020 at 10:47 AM, mlondon said: Hi, Got it working on Mojave, thank you. However I see that the workflow just toggles each Airplay target on/off. I would like to be able to SWITCH from one to another. For example, iTunes is set to play to Computer. Using your workflow, I have to toggle Computer OFF, and then toggle my speakers ON. Is there a way to SWITCH instead of the current behaviour? Thanks again... Just pushed an update based on your request. Give it a shot and let me know if it works for you. You'll just need to change the default behavior from "toggle" to "select" in the variables section, per the About This Workflow page in Alfred. Please let me know if you have any issues or other ideas on improvements! https://github.com/dotson/iTunes-Airplay-Toggle Link to comment
mlondon Posted May 4, 2020 Share Posted May 4, 2020 3 hours ago, smirky said: Just pushed an update based on your request. Give it a shot and let me know if it works for you. You'll just need to change the default behavior from "toggle" to "select" in the variables section, per the About This Workflow page in Alfred. Please let me know if you have any issues or other ideas on improvements! https://github.com/dotson/iTunes-Airplay-Toggle Really appreciate this! However, now when I trigger the workflow, it tries to open Parallels app (for Windoze emulation). I have zero idea why this is happening. Doesnt matter what I change your workflow hotkey to, still invokes Parallels None of my AirPlay devices are connected to Windoze in any way. Very strange.... Link to comment
smirky Posted May 4, 2020 Share Posted May 4, 2020 35 minutes ago, mlondon said: Really appreciate this! However, now when I trigger the workflow, it tries to open Parallels app (for Windoze emulation). I have zero idea why this is happening. Doesnt matter what I change your workflow hotkey to, still invokes Parallels None of my AirPlay devices are connected to Windoze in any way. Very strange.... Well that’s super weird, sorry about that! Does the workflow work as expected but also triggers Parallels or does it not work at all plus Parallels opens up unexpectedly? Can you post the output from Alfred’s debug window after you run the workflow? What’s your Mac OS and Parallels version? I’ll see if I can mirror those and replicate this locally to sort it out. Link to comment
mlondon Posted April 20, 2023 Share Posted April 20, 2023 Hi @smirky Workflow is working fine (I deleted Parallels) However, I would like to trigger it using an Alfred Keyword instead of the function key. I added a keyword trigger, but its not working. Is this possible? How should I configure the keyword trigger (I'm not an Alfred expert) Thank you, Matthew Link to comment
smirky Posted April 21, 2023 Share Posted April 21, 2023 22 hours ago, mlondon said: However, I would like to trigger it using an Alfred Keyword instead of the function key. I added a keyword trigger, but its not working. Hi Matthew! The simplest way for now would be to add your keyword to the first Script Filter action, see the two screenshots below. A better long term solution would be for me to add the keyword trigger and allow the user to customize it in the settings so that it stays after future updates. I might be able to work on that this weekend. Until then, the solution in the screenshots should do what you need just fine. Let me know if you have any questions! Link to comment
smirky Posted April 23, 2023 Share Posted April 23, 2023 On 4/20/2023 at 8:21 AM, mlondon said: Hi @smirky Workflow is working fine (I deleted Parallels) However, I would like to trigger it using an Alfred Keyword instead of the function key. I added a keyword trigger, but its not working. Is this possible? How should I configure the keyword trigger (I'm not an Alfred expert) Thank you, Matthew Just posted an update to this workflow that gives you a keyword option in the workflow configuration page. This update should get pushed to your device via OneUpdater or you can grab it direct from Github. Let me know if you run into any issues! https://github.com/dotson/iTunes-Airplay-Toggle Link to comment
vitor Posted May 23, 2023 Share Posted May 23, 2023 @smirky Would you like to submit this for the Gallery? I took a look and I’m only seeing two things missing:OneUpdater has to be removed, so it does not conflict with the Gallery’s own updating.I’ll need a high resolution screenshot, with the airtog keyword visible (as opposed to trigged by the keyword).Both have more details on the linked page. Link to comment
smirky Posted May 24, 2023 Share Posted May 24, 2023 7 hours ago, vitor said: @smirky Would you like to submit this for the Gallery? Thanks Vitor, that would be cool. I don't have a retina display available so I generally avoided the idea of submitting my workflows. If someone was able to share a screenshot or two, I could add them to the ReadMe and make the update in #1 above all in one shot. Should I create a new thread in the other subforum for ease of tracking this? I'm happy to do that as well. Link to comment
vitor Posted May 29, 2023 Share Posted May 29, 2023 (edited) On 5/24/2023 at 2:11 AM, smirky said: Should I create a new thread in the other subforum for ease of tracking this? I'm happy to do that as well. Yes, please. Do so after making a new release removing auto-updating and I’ll get on with adding it. On 5/24/2023 at 2:11 AM, smirky said: I don't have a retina display available so I generally avoided the idea of submitting my workflows. That’s alright. As the post says: “If you don’t have a retina screen, let us know”. Don’t worry about that part, I’ll reproduce it. But please do submit screenshots for future submissions, even if not retina, because it helps with determining what’s the desired behaviour of the workflow. By the way, would it be a good time to change the name of the workflow to “Music Airplay Toggle”? It doesn’t have to change, but it occurred to me as a possibility. Edited May 29, 2023 by vitor 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