This script creates a 00-playlist.m3u file with the mp3, ogg or flac files in the current folder.
The m3u format delivered has the basic syntax, no # tags inside. But it works everywhere, foobar2000, vlc, winamp, so...
This post can also be used to make a similar utility based in create a file with the filenames listed.
The utility needs a Windows Powershell script.
Here we go:
Create a Powershell script with the code:
Get-ChildItem *.* -include *.flac,*.ogg,*.mp3 -name | Out-File -Encoding UTF8 00-playlist.m3u
(You can change the output filename '00-playlist.m3u' here)
In this example we save this code in the file C:\Users\jp\App\powershell\createm3u.ps1
If this is the first time you use this Windows Powerscript, you need to grant yourself exec permissions.
Go to the Powershell console (search 'powershell' in windows start button) and type:
You only have to do this thing only one time in you computer. More info here.
Now go to DOpus and create the button. This is the code:
See how to add buttons from this forum to your toolbars for how to paste the XML.
<?xml version="1.0"?> <button backcol="none" display="both" textcol="none"> <label>Create m3u</label> <tip>Create m3u playlist file</tip> <icon1>#play2</icon1> <function type="batch"> <instruction>powershell.exe C:\Users\jp\App\powershell\createm3u.ps1</instruction> </function> </button>
If you prefer doing it manually, without pasting the XML:
- Right-click over empty space on toolbar->[Customize].
- Right-click over toolbar where you want the button->[New->Button]
- Right-click over newly created button->[Edit...]
- Define icon, label ('Create m3u'), Tip ('Create m3u playlist file')
There is a pretty suited icon with a musical note in the 'Tools' icon section.
- Select Function->MS-DOS Batch Function.
- Put this code:
Note that the path is my example path. Make sure yours is correct.
- Press OK
This is it. Now if you press this button when in a folder with mp3, ogg or flac files, it will create the .m3u file with them.