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.
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
andresponse
.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 returntrue
. 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.