Closed rmehner closed 11 years ago
About the separation of the AppleScript: I'd love to do that for the other not-single line applescripts as well, as it makes maintaining way easier. But that might be a matter of taste.
If you prefer, I can inline the script for the artwork as well. Let me know what you think.
I experienced a problem with the applescript in OSX 10.7. It has problems with the colons in the track id, which is used for the filename. I replaced colons with underscores to get it working in Lion (see: https://github.com/andrehaveman/spotify-node-applescript/blob/rmehner-get_artwork/lib/scripts/get_artwork.applescript).
I like the separate files.
I merged it.
Interesting, will investigate. Also we now have the same code twice (replace_chars is basically like escape_quotes). Wanted to improve the script anyway, will open up a new PR then :)
This implements a getArtwork method that gets the current artwork as PNG (from the actual TIFF Data that spotify returns). The conversion to PNG happens because it's more compatible with current browsers and everything.
Example:
Please note: The used applescript takes some time (0.5s to 1.5s on different machines), so don't run the script too often (not every second) or you will run into strange errors. Especially don't run them in parallel.
Also the apple script is seperated into an external file, which makes it easier to maintain IMHO.