Page 1 of 1

Script not work in Xyplorer12.40

Posted: 01 May 2013 18:07
by Dario
I use this script:
http://www.xyplorer.com/xyfc/viewtopic. ... m3u#p61748
and it works fine, until I update to xyplorer_12.40.

This *.m3u playlist file

Image

Script return this in earlier xyplorer version

Image

and in xyplorer12.40 I get this

Image

Re: Script not work in Xyplorer12.40

Posted: 01 May 2013 18:32
by highend
Be more precise, which code do you use exactly? There are a few versions in that thread...

Re: Script not work in Xyplorer12.40

Posted: 01 May 2013 18:47
by Dario
I used first code in topic. This:

Code: Select all

$d = readfile(<curitem>);
 $e = regexreplace ($d, "#(.*?)(.*)", "");
 replace $e, $e, "<crlf>", "|";
 replace $e, $e, "<crlf>", "";
 $f = substr("$e", 0, 1);
 replace $g, $e, "$f", "";
 open inputselect("Pick the file you want to play", $g);

I see, here in forum in Script Exchange, users complain to, script DiskManager not work, too, in xyplorer 12.40.

Re: Script not work in Xyplorer12.40

Posted: 01 May 2013 19:03
by TheQwerty
I'm not sure if this is the only change but it seems Don finally removed the deprecated Replace command:

Code: Select all

replace $result, $haystack, "needle", "replacement";
Which should have been converted to the Replace function long ago:

Code: Select all

$result = Replace($haystack, "needle", "replacement");
So to fix that script try:

Code: Select all

"Select from Playlist"
 $d = readfile(<curitem>);
 $e = regexreplace ($d, "#(.*?)(.*)", "");
 $e = replace($e, "<crlf>", "|");
 $e = replace($e, "<crlf>", "");
 $f = substr("$e", 0, 1);
 $g = replace($e, "$f", "");
 open inputselect("Pick the file you want to play", $g);

Re: Script not work in Xyplorer12.40

Posted: 01 May 2013 20:10
by Dario
Yes. Your fix work fine.
Thanx so much. :D

Re: Script not work in Xyplorer12.40

Posted: 01 May 2013 20:21
by highend
Or just use a oneliner:

Code: Select all

open inputselect("Pick the file you want to play", formatlist(regexreplace(readfile("<curitem>"), "(^#.*)|(\r?\n)", "|"), "e"));

Re: Script not work in Xyplorer12.40

Posted: 02 May 2013 00:37
by Dario
Wow. It is even better. Can you make inputselect window bigger, maybe 600x600, and I need one variant of same script, but without full path. I mean, that script return only name of files.
tnx

Re: Script not work in Xyplorer12.40

Posted: 02 May 2013 06:49
by highend
Larger window (adapt the numbers as you like):

Code: Select all

open inputselect("Pick the file you want to play", formatlist(regexreplace(readfile("<curitem>"), "(^#.*)|(\r?\n)", "|"), "e"), , , , 800, 600);
Only file names (this will only work if the playlist file is in the same directory as the music files...):

Code: Select all

open "<curpath>\".inputselect("Pick the file you want to play", formatlist(regexreplace(readfile("<curitem>"), "(^#.*)|(\r?\n)|(^.*\\)", "|"), "e"), , 4, , 800, 600);

Re: Script not work in Xyplorer12.40

Posted: 02 May 2013 10:08
by Dario
I really appreciate your help. Thanx. :D