6

as a "switcher" I have discovered one functionally that I like in Windows and I don't see in Mac. I want to play all the media files in a folder with VLC with the right click and "Play all" but in this case I need to first open VLC, then click in "Open" and then browse through the folders to finally play the files. Is there any way to play a entire folder with only the right button?

Thanks in advance, best regards.

2
  • What happens if you select a few files in the Finder, then right click on them and select Open? Does it open VLC and add them to the playlist? Commented Sep 4, 2014 at 13:04
  • And you do mean Play a FOLDER no a play file ?
    – Ruskes
    Commented Sep 4, 2014 at 13:13

1 Answer 1

7

It doesn't appear possible to do something like VLC folder/ folder2/ from the command line. Instead I've successfully created an Automator service that generates a playlist and launches the application passing the list to it.

Here is the service... VLC Service

To include subfolders enable the option Repeat for each subfolder found in the first action shown above.

To save you the typing, the shell script code is as follows,

# Create playlist with default sorting
PLSFILE=/tmp/VLC_`date +%s`_$$.m3u
sort -V > $PLSFILE

# If file empty just exit
[ -s $PLSFILE ] || exit 0

# Remove following if you want to add to list instead of replacing it
killall VLC && sleep 1


# Launch VLC with our new playlist
open -a /Applications/VLC.app/Contents/MacOS/VLC $PLSFILE --args --playlist-autostart

The shell script will do nothing if Finder doesn't find any media files. If VLC is already playing, it will add the files to is existing list. Check the VLC documentation for more information on available options.

Finally you can launch it by right clicking on a folder and then select Services...

VLC Service Launch

Hope that helped.

3
  • Solution works a charm, thanks! I was confused for a bit when my folders kept opening to a track other than the first one. It turns out I had accidentally left VLC set to play tracks in random order.
    – Keyslinger
    Commented Jul 1, 2016 at 1:07
  • This works great, thanks! I looked at VLC's documentation and couldn't find the answer: do you know how to get VLC to overwrite its current playlist and load only the files from the folder(s) I clicked? Commented Jul 7, 2020 at 19:49
  • @MikeMiller It doesnt appear to have the ability to replace the list. So I added a line in the code to close the app and restart it with a new list. It adds a small delay but it works. Commented Jan 31, 2021 at 0:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .