PM123's Remote command reference - Playlist manipulation

Command Description Reply
playlist <url> Select a playlist or a folder. This setting only affects the pipe interface. URL or empty string on error.
pl_next [<count>](2) Navigate to the next item in the current playlist. If <count> is specified, you can skip more than one item at once. URL of the item or an empty string at the end of the list.
pl_previous [<count>](2) Navigate to the previous item in the current playlist. If <count> is specified, you can skip more than one item at once. URL of the item or an empty string at the end of the list.
pl_reset(2) Reset the current item of the playlist. The current location is now before the start or past the end respectively.  
pl_current Query the current playlist. URL of the item or an empty string if none.
pl_itemQuery the current item in the current playlist.URL of the item or an empty string if none.
pl_indexQuery the index of the current item within the current playlist.
Be careful, because the index changes when the playlist is modified and you might be not the only one that modifies a playlist.
Index starting from 1 or 0 in case of no current item.
use Use the current playlist. This is equivalent to 'load <URL to current playlist>'. Result code, non-zero = error.
clear Clears the current playlist.  
add <url> [<url> [...]] Adds URLs or files to the current playlist. The items are added before the current item. If the current item is past the end the new items are appended.
The names or URLs can be enclosed with double quotes. The operation is atomic, but it is not transactional in case of an error.
Empty = OK,
Failed URL on error.
dir <directory>(1) Add <directory> to the playlist (non-recursive).
Deprecated, use add instead.
Empty = OK,
Failed URL on error.
rdir <directory>(1) Add <directory> to the playlist (recursive).
Deprecated, use add <directory>?recursive instead.
Empty = OK,
Failed URL on error.
remove Removes currently selected item from the current playlist. URL of the removed item or empty string on error.
save [<file>] Save the current playlist as <file>. If <file> is omitted the playlist is saved in place. This only works on mutable lists. Result code, non-zero = error.

Notes

  1. The behavior of the directory commands has significantly changed with PM123 1.40. The content of the directories is no longer expanded inline into the playlist. A reference to the directory is added to the playlist instead. This has several side effects. Unplayable items appear in the navigation. The directory is rescanned every time the playlist is loaded.

  2. In PM123 before version 1.40 the playlist manipulation commands always operate on the currently playing item. Now the new commands pl_prev, pl_next and pl_reset are dedicated to playlist operations.