Page 5 of 8

Re: Miscellaneous - Questions

Posted: 30 Apr 2020 09:50
by MaxEnrik
Thank you for the key words! I'll do.

Re: Miscellaneous - Questions

Posted: 25 Feb 2021 13:33
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);
    }

Re: Miscellaneous - Questions

Posted: 25 Feb 2021 14:01
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");
?

Re: Miscellaneous - Questions

Posted: 25 Feb 2021 14:29
by MaxEnrik
The problem still the same and stays.

Re: Miscellaneous - Questions

Posted: 25 Feb 2021 14:33
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...

Re: Miscellaneous - Questions

Posted: 25 Feb 2021 15:09
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

Re: Miscellaneous - Questions

Posted: 25 Feb 2021 16:00
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);
    }

Re: Miscellaneous - Questions

Posted: 25 Feb 2021 16:39
by MaxEnrik
It works perfect. Thank you!

Re: Miscellaneous - Questions

Posted: 02 Mar 2021 15:05
by MaxEnrik
I'd like to know differences of these two regex.

Code: Select all

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

Re: Miscellaneous - Questions

Posted: 02 Mar 2021 15:10
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)

Re: Miscellaneous - Questions

Posted: 02 Mar 2021 15:20
by MaxEnrik
Thank you for the explanations.

Re: Miscellaneous - Questions

Posted: 25 Jul 2021 23:43
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.)

Re: Miscellaneous - Questions

Posted: 02 Aug 2021 12:23
by admin
Not possible.

Why?

Re: Miscellaneous - Questions

Posted: 23 Aug 2021 22:43
by MaxEnrik
Because its so easy to tracking location and file names.

Re: Miscellaneous - Questions

Posted: 24 Aug 2021 10:11
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.