andrehaveman / spotify-node-applescript

Control Spotify on Mac OSX with NodeJS and AppleScript
MIT License
316 stars 38 forks source link

Refactor isRunning #12

Closed mrnugget closed 11 years ago

mrnugget commented 11 years ago

After spending more time with AppleScript I found a lot nicer method of determining whether Spotify is running or not.

This shrinks isRunning down to one, easy-to-understand line, using running attribute of the application Spotify. Apparently every application has a running attribute, which I didn't know about before.