Cauder
Cauder

Reputation: 2597

How to Clear VLC Playlist with Apple Scripts

By default, VLC will keep the songs that were played in the last session as part of the playlist. I have an AppleScript that plays music that is stored as MP3 files in a folder.

tell application "VLC"
    set thePlaylist to "file:////Users/[username]/Music/Playlist"
    OpenURL thePlaylist
end tell

Since VLC stores the last songs, it will start playing from wherever the song was last and then play from this playlist afterwards.

I've tried a couple of commands, but I haven't been able to clear the playlist from my AppleScript.

Upvotes: 0

Views: 338

Answers (1)

Ted Wrigley
Ted Wrigley

Reputation: 3184

Short answer: you can't do this through AppleScript. VLC's scripting dictionary is only a list of verbs — actions that can be performed on the current playing item — it has no nouns or object references that would let you specify things like 'playlists', 'videos', 'tracks', etc. There is no way to 'talk' to VLC about anything other than the currently queued item.

That might be something to report to VLC's developer. It's a weak AppleScript dictionary.

You might be able to fix this in VLC's Preferences. Looking at the full settings in VLC (click the "Show All" button at the bottom left) the two I highlighted seem like the might give you some control.enter image description here There might be other setting that I didn't see; you should look through the options.

Upvotes: 1

Related Questions