Help with an m3u playlist button

I know this has been touched on before in this post:

but I've been using this button to create an m3u playlist and suddenly it has stopped working:

<?xml version="1.0"?>
<button display="both" icon_size="large" separate="yes">
	<label>Create M3U</label>
	<icon1>E:\Icons\M3U.ico,0</icon1>
	<function type="batch">
		<instruction>@NOFILENAMEQUOTING</instruction>
		<instruction>RUNMODE HIDE</instruction>
		<instruction>Select PATTERN *.(mp3|ogg|flac|aac|ape) DESELECTNOMATCH</instruction>
		<instruction>sync: Echo #EXTM3U&gt;&quot;{sourcepath$|nopath}.m3u&quot;</instruction>
		<instruction>sync: Echo {file$}&gt;&gt;&quot;{sourcepath$|nopath}.m3u&quot;</instruction>
	</function>
</button>

Has anything changed recently in Dopus to make any of the above code fail?

The button in the above link does work but puts the playlist in the documents folder. Can this be changed to name the playlist with the folder name and place it in the same folder with the music files?

Many thanks....

Here's a fixed version:

(Note: This doesn't work if the audio file has an & in its name. See page 2.)

@NOFILENAMEQUOTING
@RUNMODE HIDE
Select PATTERN *.(mp3|ogg|flac|aac|wma) DESELECTNOMATCH
Echo #EXTM3U>"{sourcepath$|nopath|noterm}.m3u"
Echo {file$}>>"{sourcepath$|nopath|noterm}.m3u"
<?xml version="1.0"?>
<button display="both">
   <label>Create M3U</label>
   <icon1>48</icon1>
   <function type="batch">
      <instruction>@NOFILENAMEQUOTING</instruction>
      <instruction>@RUNMODE HIDE</instruction>
      <instruction>Select PATTERN *.(mp3|ogg|flac|aac|wma) DESELECTNOMATCH</instruction>
      <instruction>Echo #EXTM3U&gt;&quot;{sourcepath$|nopath|noterm}.m3u&quot;</instruction>
      <instruction>Echo {file$}&gt;&gt;&quot;{sourcepath$|nopath|noterm}.m3u&quot;</instruction>
   </function>
</button>

The important change is the extra |noterm on the last two lines which stops the \ being added to the end of the folder path.

The original button was trying to write to FolderName.m3u instead of FolderName.m3u

Just for neatness, I also removed the two sync: prefixes as they're not needed anymore (but they were harmless) and put a @ before the RUNMODE HIDE (but that was harmless too).

I tried this updated code. I don't know what it's supposed to be doing because when I run it...nothing happens. I'm using the latest version of DO and XP Home Edition with 1 gig of ram.

Are there any MP3, OGG, FLAC, AAC or WMA files in the folder you're running it from?

Errr .... Why would you try a button without having any idea what it's supposed to do ?

The purpose of the code was mentioned by the OP in the first post.

Yep. It quickly highlights ALL of them...and then nothing.

It doesn't spit out a .M3U file in the same folder?

@DorthyFan1
You wrote:

I'm wondering, before you pressed the fixed button, did you select the files you wished to include in the playlist ?

The command selects the files automatically so you don't need to do this.

Sorry about that Jon.
Yes of course, it is working perfectly here.
But, may I ask, does it work for DorthyFan1 with the files selected prior to pressing the button ?

I'm wrong on this.
I need to dig deeper.
Please disregard my suggestions.
Thanks and Sorry Jon.

It's definitely not working for me. And yes, i do select the MP3 files before hitting the button...so nothing seems to happen.

It doesn't spit out a .M3U file in the same folder?

Nothing is created. I checked.

Is there already an M3U in the folder?

Do you hare write access to the folder?

What happens if you run this version:

<?xml version="1.0"?>
<button display="both">
	<label>Test</label>
	<icon1>48</icon1>
	<function type="batch">
		<instruction>@NOFILENAMEQUOTING</instruction>
		<instruction>Select PATTERN *.(mp3|ogg|flac|aac|wma) DESELECTNOMATCH</instruction>
		<instruction>Echo #EXTM3U_&quot;{sourcepath$|nopath|noterm}.m3u&quot;</instruction>
		<instruction>Echo {file$}__&quot;{sourcepath$|nopath|noterm}.m3u&quot;</instruction>
		<instruction>pause</instruction>
	</function>
</button>

It should open a window and print some filenames (with some stuff after them).


Leo...I'm not interested in printing any files. I currently don't have a printer connected to my laptop. I just want to create playlists from my music file collection easily that can be read in winamp, etc.

The code you put up would only put a print request to a non existing printer to my queue and it won't go anywhere. I don't see how using this code snippet is going to help.

Print to the screen, like in the screenshot I provided, not a printer.

I've been itching to get home from work to try the button out and I can report that the XML version works perfectly for me.

The smaller 5 line version of it doesn't work and windows reports 'windows cannot find echo. Make sure you typed the name correctly'. To try this one I've just created a new button and pasted the code into the expanded advanced box. I'm using Win7 RC1 by the way.

Many thanks Leo.

Make sure you have the button set as an MS-DOS command.

Yes that's what I left out, it works with it set as an MS-DOS command. Thank you Jon.