andrehaveman/spotify-node-applescript — pull request #7 by mrnugget (2013-02-04 11:03:14+00:00)
Title: Implement isRunning to check whether Spotify is running or not

This commit adds a `isRunning` method, that checks via AppleScript if
the Spotify application is running or not.

`isRunning` takes a callback as argument. The callback gets passed two
arguments: `error` and `response`. `error` is a possible error bubbling up from
node-applescript.

`response` is a boolean, indicating whether Spotify is running (true) or not
(false).

The included test assumes that Spotify is running (as does the whole test
suite) and expects `isRunning` to return `true`. I did not bother to include the
negative version of the test, since that would mean changing a lot of the test
suite (including quitting and restarting spotify). But the method has been
tested manually and works as expected.