Random m3u Mac help

September 14, 2016 at 01:25:52
Specs: Mac OsX
Trying to find a way of generating an m3u playlist with one file per subfolder.

Can generate an m3u per subfolder but looking for just one m3u file with a single random file per subfolder.


See More: Random m3u Mac help

Report •


#1
September 14, 2016 at 03:32:37
What have you got so far?

I've never seen a mac script.

=====================

M2 Get custom script or take private lessons


Report •

#2
September 14, 2016 at 04:12:25
It's bash. OS X is based off of FreeBSD, so its scripting language is bash.

How To Ask Questions The Smart Way


Report •

#3
September 14, 2016 at 04:22:37
Hi R2,

Yea, you got your bash [bourne again shell]
Why no mash? [marinate again shell] LOL

=====================

M2 Get custom script or take private lessons


Report •

Related Solutions

#4
September 14, 2016 at 15:49:27
This is similar to a post I answered here:

http://www.computing.net/answers/li...

I am assuming each file has a m3u extension???

#!/bin/bash

# change to your directory name
yourdir="/export/home/nails/s1"
cd $yourdir

# find files ONLY IN THE CURRENT DIRECTORY
# then foreach file remove the extension and make the directory from 
# that name. finally move the file to that directory
find . ! -name .  -prune -type f| while read myfile
do
   noext=${myfile%.*} # remove the extension
   mkdir -p $noext    # make the directory if it doesn't exist
   mv $myfile $noext  # move the file to the directory
done


Report •

#5
September 14, 2016 at 17:08:33
An M3U file is a text file containing a list of media files. I don't remember where it started, but I know it because of Winamp.
File header:
#EXTM3U

Each entry takes two lines:
#EXTINF:<runtime time in seconds>,<Title>
<Path to file>

I'm not sure if the first line for the entries (the #EXTINF: lines) is required. It might be dependent on the media player.

So unless I'm reading this wrong, the OP wants a script that will make a text file starting with #EXTM3U, and then one random file from every subdirectory.

How To Ask Questions The Smart Way

message edited by Razor2.3


Report •

Ask Question