Page 1 of 1

Using Airfoil Pro, I want to play a file in Spotify

PostPosted: Fri Jun 10, 2022 3:38 pm
by jroach
I want to play a specific file called "Announcement" at sunset everyday. Using an Indigo schedule and AirfoilPro I can accomplish it but it opens the "Announcement" file with Apple Music. I'm using WAV, AAC, FLAC or MP3...but none of these allow Spotify to run when the file is executed outside of Spotify ie: When I right click and "open with" it says that it is an invalid file type. I have imported the file into a playlist (and it plays) but from the Airfoil plugin I don't see an option on how to play a specific file in Spotify.
Normally this wouldn't be a problem opening it Music but I want to kickoff a light show using 'iLightshow" which only works with Spotify (Music if its on iOS but I am running this on a Mac mini). Any thoughts on a work-around?

Re: Using Airfoil Pro, I want to play a file in Spotify

PostPosted: Fri Jun 10, 2022 3:50 pm
by jay (support)
This seems to me to be less an Airfoil issue than it is a spotify issue. If Airfoil can select the spotify app as the source, then it's just a matter of figuring out how to tell spotify to play the right file/track. So, it's a two step process: 1) tell Airfoil to change the source to Spotify then 2) tell Spotify to play the right track. It's #2 I don't know how to do.

Re: Using Airfoil Pro, I want to play a file in Spotify

PostPosted: Sat Jun 11, 2022 10:16 am
by jroach
Jay, thanks!

Agree, it's #2 that stumps me as well. Today I am using airfoil to play a Spotify playlist that I start manually. At sunset, using Airfoil Pro plugin, I change the source to Music then open file: Sunset Announcement, switching source back to Spotify after the announcement has finished. If I could use "open file" to play the announcement under Spotify I would be set but it defaults to Music.
When I try to change the default player I get a message that the file type is not compatible even though it works if I open the file from Spotify. Sounds like a Spotify issue for sure but I'm kind of married to Spotify.

While I have never done it before it sounds like writing a script might be the way to solve this.

Re: Using Airfoil Pro, I want to play a file in Spotify

PostPosted: Sat Jun 11, 2022 11:17 am
by jroach
I built a script that will play the file I want from Spotify. I think this is solved. Here is the script in case anybody Is interested in playing a local file through Spotify

tell application "Spotify"
play track "spotify:track:(paste URI)"
end tell

You can find the URI for the song by using the SHARE (Ctl Click on the playlist) and "copy link"

Re: Using Airfoil Pro, I want to play a file in Spotify

PostPosted: Sat Jun 11, 2022 12:16 pm
by jroach
If anybody has any ideas on how to return to the previous Playlist that was playing it would be appreciated. I tried a script for "Previous track" but it just plays the same file over.