Play folder with right button with VLC

Solution 1:

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
PLSFILE=/tmp/VLC_`date +%s`_$$.m3u
cat > $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.