Script not work in Xyplorer12.40

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
Dario
Posts: 45
Joined: 20 Aug 2011 17:06

Script not work in Xyplorer12.40

Post 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

highend
Posts: 14956
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Script not work in Xyplorer12.40

Post by highend »

Be more precise, which code do you use exactly? There are a few versions in that thread...
One of my scripts helped you out? Please donate via Paypal

Dario
Posts: 45
Joined: 20 Aug 2011 17:06

Re: Script not work in Xyplorer12.40

Post 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.

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: Script not work in Xyplorer12.40

Post 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);

Dario
Posts: 45
Joined: 20 Aug 2011 17:06

Re: Script not work in Xyplorer12.40

Post by Dario »

Yes. Your fix work fine.
Thanx so much. :D

highend
Posts: 14956
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Script not work in Xyplorer12.40

Post 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"));
One of my scripts helped you out? Please donate via Paypal

Dario
Posts: 45
Joined: 20 Aug 2011 17:06

Re: Script not work in Xyplorer12.40

Post 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

highend
Posts: 14956
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Script not work in Xyplorer12.40

Post 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);
One of my scripts helped you out? Please donate via Paypal

Dario
Posts: 45
Joined: 20 Aug 2011 17:06

Re: Script not work in Xyplorer12.40

Post by Dario »

I really appreciate your help. Thanx. :D

Post Reply