spotify-node-applescript
Control Spotify on Mac OSX with NodeJS and AppleScript.
Installation
$ npm install spotify-node-applescript
Running unit tests
$ npm test
API
playTrack(uri, callback)
Play a track with Spotify URI uri
.
var spotify = ; spotify;
playTrackInContext(uri, contextUri, callback)
Play a track in context of for example an album.
var spotify = ; spotify;
getTrack(callback)
Get the current track. callback
is called with the current track as second argument.
var spotify = ; spotify;
getState(callback)
Get player state.
var spotify = ; spotify;
jumpTo(second, callback)
Jump to a specific second of the current song.
var spotify = ; spotify;
play(callback)
Resume playing current track.
pause(callback)
Pause playing track.
playPause(callback)
Toggle play.
next(callback)
Play next track.
previous(callback)
Play previous track.
volumeUp(callback)
Turn volume up.
volumeDown(callback)
Turn volume down.
setVolume(volume, callback)
Sets the volume.
var spotify = ; spotify;
muteVolume(callback)
Reduces audio to 0, saving the previous volume.
unmuteVolume(callback)
Returns audio to original volume.
isRunning(callback)
Check if Spotify is running.
var spotify = ; spotify;
isRepeating(callback)
Is repeating on or off?
var spotify = ; spotify;
isShuffling(callback)
Is shuffling on or off?
var spotify = ; spotify;
setRepeating(repeating/*boolean*/, callback)
Sets repeating on or off
setShuffling(shuffling/*boolean*/, callback)
Sets shuffling on or off
toggleRepeating(callback)
Toggles repeating
toggleShuffling(callback)
Toggles shuffling