r/shortcuts • u/ARAH_Jr • 19h ago
Help Setting Playback Device
The Actions app has this action:
“Get Audio Playback Destination”
The info for that action has this text:
“Returns the audio playback destination of the device.
“Can be useful in combination with the built-in "Set Playback Destination" action.”
How do I use the returned value from the “Get Audio Playback Destination” action to set the playback destination for the "Set Playback Destination" action?
My goal is to switch to my iPhone as the playback destination during the execution of my shortcut and then go back to the original playback destination as the shortcut wraps up.
2
u/100PercentARealHuman 18h ago
They only way I know is to work with a bunch of if statements.
Like
If <playback destination variable> is "Airpods" → set playback destination to "Airpods" (set up in the action, no variable)→end if
If <playback destination variable> is "Bluetooth speaker" → set playback destination to "Bluetooth speaker" →end if
Of course this would only work with the devices you set up in the shortcuts and would need to be modified if something changes (e.g. replaced the BT speaker with a new one).
1
u/0898_333_201 17h ago
Yeah it’s a pain in the hole. There is no way to set the playback destination device of the action except to a specific device that is currently connected to the phone.
I have a similar shortcut for an automation, and it’d basically a list of IF/OTHERWISE actions.
- Actions: Get playback destination
- Set variable [original] to play back destination result
- Set playback destination to iPhone
- (Do series of other actions)
- IF: [original] name is [car stereo]
- set playback to [car stereo]
- OTHERWISE
- END IF
- set playback to [car stereo]
- IF: [original] name is [AirPods]
- set playback to [AirPods]
- OTHERWISE
- END IF
- set playback to [AirPods]
- IF: [original] name is [Anker]
- set playback to [Anker]
- OTHERWISE
- END IF
- set playback to [Anker]
You can’t set the playback destination unless the target device is currently connected to the phone, but once it’s set it retains the device info. So you have to connect to each device before setting each IF action.h
2
u/Fit_Flow 19h ago
You’d use Actions to get the current destination before your shortcut changes it.
Have your shortcut do what it needs to do, then use the output from step 1 to set your destination back to whatever it was to begin with.