Miscellaneous - Questions

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
MaxEnrik
Posts: 107
Joined: 20 Apr 2019 02:34

Re: Miscellaneous - Questions

Post by MaxEnrik »

Thank you for the key words! I'll do.

MaxEnrik
Posts: 107
Joined: 20 Apr 2019 02:34

Re: Miscellaneous - Questions

Post by MaxEnrik »

#1 Open - File name has . (dot). Causing to clear .extension.

Below code works fine until file name has .dot in it. And it causing to clear file .extension.
But of course I don't need to clear .extension of the file name.
Is there a chance to solve this issue?

(hope I explained well enough with my poor English)

Code: Select all

    foreach($item, <get selecteditemspathnames>, <crlf>, , "No files selected!") {
        $base = gpc($item, "base", 2, 0);
        $newName =  regexreplace($base, ".*\] (.*) \[.*", "$1");
        renameitem($newName, $item);
    }

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Miscellaneous - Questions

Post by highend »

What?

Your $base definition is nonsense, index and flags only apply to component, not to base

Something like

Code: Select all

$base    = regexreplace(gpc($item, "file"), "^(.+)\.[^.]+$", "$1");
?
One of my scripts helped you out? Please donate via Paypal

MaxEnrik
Posts: 107
Joined: 20 Apr 2019 02:34

Re: Miscellaneous - Questions

Post by MaxEnrik »

The problem still the same and stays.

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Miscellaneous - Questions

Post by highend »

Cool. Which problem exactly?
Show a real file name with path and how it should look like after your script has finished its work...
One of my scripts helped you out? Please donate via Paypal

MaxEnrik
Posts: 107
Joined: 20 Apr 2019 02:34

Re: Miscellaneous - Questions

Post by MaxEnrik »

These are original file names.

Code: Select all

[audio_3(967)] Soundtrack final __ promo [a.udo].mp3
[Video_A(0489)] DESIGN Title sequence Part.3 __ Edition Universe [a.mpv].mkv

These are what I expect.

Code: Select all

Soundtrack final __ promo.mp3
DESIGN Title sequence Part.3 __ Edition Universe.mkv

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Miscellaneous - Questions

Post by highend »

rename() isn't smart enough for this, so just give the file to rename its extension...

Code: Select all

    foreach($item, <get selecteditemspathnames>, <crlf>, , "No files selected!") {
        $base    = regexreplace(gpc($item, "file"), "^(.+)\.[^.]+$", "$1");
        $newName = regexreplace($base, ".*\] (.*) \[.*", "$1");
        renameitem($newName . "." . gpc($item, "ext"), $item);
    }
One of my scripts helped you out? Please donate via Paypal

MaxEnrik
Posts: 107
Joined: 20 Apr 2019 02:34

Re: Miscellaneous - Questions

Post by MaxEnrik »

It works perfect. Thank you!

MaxEnrik
Posts: 107
Joined: 20 Apr 2019 02:34

Re: Miscellaneous - Questions

Post by MaxEnrik »

I'd like to know differences of these two regex.

Code: Select all

    $newName = regexreplace($base, "\..*");
    $newName = regexreplace($base, "\.[^.]+?$");

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Miscellaneous - Questions

Post by highend »

The first would remove everything (including) the first dot and everything after it
while the second one would only remove the last dot with "something" behind it (which can't be a dot)
One of my scripts helped you out? Please donate via Paypal

MaxEnrik
Posts: 107
Joined: 20 Apr 2019 02:34

Re: Miscellaneous - Questions

Post by MaxEnrik »

Thank you for the explanations.

MaxEnrik
Posts: 107
Joined: 20 Apr 2019 02:34

Re: Miscellaneous - Questions

Post by MaxEnrik »

I would like to change Status Bar's text alignment from 'Center' to 'Left', is there a chance to do this?
(Status Bar when Full Screen Mode for preview images.)

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Miscellaneous - Questions

Post by admin »

Not possible.

Why?

MaxEnrik
Posts: 107
Joined: 20 Apr 2019 02:34

Re: Miscellaneous - Questions

Post by MaxEnrik »

Because its so easy to tracking location and file names.

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Miscellaneous - Questions

Post by admin »

I see what you mean. Next beta:

Code: Select all

    + Floating Preview: The right-click menu of the Floating Preview's Status 
      Bar now has a toggle "Left-Align Status Text". Does what it says.

Post Reply