Question / Help How To Display "Current Song is X" on Mac?

badgeroni

Member
For someone like me thats very poor with technical stuff with computers this seems very difficult, surely something easier can be designed for us guys on the Macs to be able to have our 'now playing' using spofify (most streamers use spotify)

will this feature ever be available to us mac users?
 

dzomb

New Member
I'm glad it helped you guys out!! I just made a twitch account, so if you like the script, or have any questions, you can get at me here, or on twitch @im_dzomb
 

NateSnowstorm

New Member
The script should open up in Apple Script, when you're there, goto File > Export and select the Application file format. This way you don't need to run it from Apple Script every time. (Just a convenience feature anyone might want to use.)

It'll ask you to select a text file, but the first time you run it, just type in a name that doesn't already exist, and just use that same file every time. You can then add that text file to OBS and, when iTunes (or any other Music player - just change where it says "iTunes" to the name of the player, like "Spotify") is playing music the file will have the text in it. Also make sure iTunes is running.


If that doesn't work, you can always just window capture the iTunes mini player. That works well enough and is incredibly simple.
 

CaptainAverage

New Member
It'll ask you to select a text file, but the first time you run it, just type in a name that doesn't already exist, and just use that same file every time. You can then add that text file to OBS and, when iTunes (or any other Music player - just change where it says "iTunes" to the name of the player, like "Spotify") is playing music the file will have the text in it. Also make sure iTunes is running.

Great script - have been beavering away on something similar in AppleScript that works with Spotify. It turns out that the most recent version of the Mac desktop Spotify client breaks the AppleScript hooks (for no good reason whatsoever, as far as I can tell!).

There's a good article from Wired that outlines how to downgrade to the previous version - which you'll need to get AppleScript talking to Spotify – and block auto-updates here.

Once you've done that, AppleScript and Spotify should promptly bury the hatchet and talk to each other once again.

Although my solution is nowhere near as awesome as Nate's one, running this AppleScript should confirm it works (you can change the destination file and folder to whatever you like):

Code:
tell application "System Events"
    set num to count (every process whose name is "Spotify")
end tell

if num > 0 then
    tell application "Spotify"
        set playState to (player state as text)
        if playState is equal to "playing" then
            set trackName to name of current track
            set artistName to artist of current track
            set albumName to album of current track
            set trackInfo to trackName & " | " & artistName & " | " & albumName
        else
            set trackInfo to "Nothing playing"
        end if
        do shell script "echo " & quoted form of trackInfo & " > $HOME/Desktop/Test.txt"
    end tell
else
    set trackInfo to "Nothing playing"
    do shell script "echo " & quoted form of trackInfo & " > $HOME/Desktop/Test.txt"
end if
 

dzomb

New Member
Wow, I'm glad to see people embracing this script.

@NateSnowstorm hit the nail on the head with the app export deal, I had done the same thing and named it Tuneout. Figured I'd upload the apple script to github so people can read it and not be sketched out by some random app.

I'll add the app export tip to the github page - If anyone needs help - or wants to get in touch, you can reach me at im.dzomb@gmail.com :)
 

Tomvkgames

New Member
i threw together this apple script to grab the itunes now-playing info and write it to a text file every 5 seconds... kind of a hack but it works

https://github.com/dzomb/tuneout
Everything worked fine but in OBS i can't open a txt file, even if i select "select txt files".
I also tried to duplicate to RTF file, but of course that doesn't work because the source code isn't stored there.
What do do?
P.S very nice script!
 

keybounce

Member
I believe there is a "chat mode (last 6 lines)" option on the text file.

So, if you wrote out the song title, and 5 blank lines, presto!
 
Top