Skip to content
This repository has been archived by the owner on Jul 4, 2020. It is now read-only.

Spotify AppleScript API inconsistently reports track title #1319

Open
mattbroussard opened this issue Aug 11, 2019 · 6 comments
Open

Spotify AppleScript API inconsistently reports track title #1319

mattbroussard opened this issue Aug 11, 2019 · 6 comments

Comments

@mattbroussard
Copy link

I know this repo isn't quite the right place for this bug report as it isn't directly about the Web API, but I emailed [email protected] and they directed me here.

The "current track" entity exposed via AppleScript/Scripting Bridge in the Spotify Mac desktop app seems to sometimes return an empty string for title/artist of the currently playing track. It does work sometimes. I'm not 100% sure, but I think the issue may be related to Spotify Connect as I have only just started noticing the issue as I've been recently listening through a Sonos speaker.

I originally noticed this because of a third party application that emits macOS notifications when the track changes, but after debugging a bit and reading the code of that app, it seems to just use the AppleScript bridge and I can verify that the following fails similarly (track title missing, but track ID is present):

$ osascript -e "tell application \"Spotify\" to get name of current track"

$ osascript -e "tell application \"Spotify\" to get id of current track"
spotify:track:1jILVSedO8KYfAZiXvRHcW
$ 

The issue on that project where this is being discussed is citruspi/Spotify-Notifications#112

Steps to reproduce:

Run osascript -e "tell application \"Spotify\" to get name of current track" on a Mac where the Spotify desktop app is running.

Expected behaviour:

Returns title of currently playing track

Actual behaviour:

Returns empty string (intermittently)

@N9199
Copy link

N9199 commented Apr 25, 2020

I have the same problem, it happens inconsistently and it also happens with artist name. I can verify its happening with spotify version 1.1.31.703.g256add22.

$ osascript -e "tell application \"Spotify\" to get artist of current track"

$ osascript -e "tell application \"Spotify\" to get id of current track"
spotify:track:0BeqAOrNdJYuqbeVU0BnFt

@N9199
Copy link

N9199 commented Apr 27, 2020

Update to my comment two days ago, it also happens while playing without spotify connect. And now sometimes at the start of the song it gives both the artist and track name, but after a while (it's inconsistent) it stops reporting both.

@Booligoosh
Copy link

+1, any update on this @spotify?

@endy-s
Copy link

endy-s commented May 5, 2020

Also facing this issue!

@cogk
Copy link

cogk commented May 6, 2020

It's weird because it seems that it still works correctly for the album name, but not the track or artist name.

osascript -e "tell application \"Spotify\" to get album of current track"

@joshubrown
Copy link
Contributor

Thanks for flagging this issue, folks. We're looking into it further here. You can follow this forum thread for updates: https://community.spotify.com/t5/Spotify-for-Developers/Apple-OSA-script-not-returning-playback-information-for-new/td-p/4940507

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants