Creating A Playlist
Wraps around this Spotify API endpoint
How to use
Spotify.Playlists.CreatePlaylist()
, expects three parameters, name
(this name you want the new playlist to have), public
(if you want the playlist to be public or not) and description
(the description you want the new playlist to have)
This will return a new playlist object owned by the user Spotify.ahk is running as. The new playlist object can then be used to add tracks to the playlist you created or can be played.
Example
This example will:
A) Create a new (empty and private) playlist named Test 123
with the description This is an example playlist made by Spotify.ahk
B) Get a track object with Spotify.Tracks.GetTrack()
and the track's Spotify ID
C) Add a track to the new playlist with .AddTrack()
, and the newly created track object
D) Will try to play the new playlist on the active device
Spotify.Auth()
NewPlaylist := Spotify.Playlists.CreatePlaylist("Test 123", "This is an example playlist made by Spotify.ahk")
TheTrack := Spotify.Tracks.GetTrack("5ogtb9bGQoH8CjZNxmbNHR")
NewPlaylist.AddTrack(TheTrack)
NewPlaylist.Play()