Miscellaneous - Questions
Re: Miscellaneous - Questions
Thank you for the key words! I'll do.
Re: Miscellaneous - Questions
#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)
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
What?
Your $base definition is nonsense, index and flags only apply to component, not to base
Something like
?
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
Re: Miscellaneous - Questions
The problem still the same and stays.
Re: Miscellaneous - Questions
Cool. Which problem exactly?
Show a real file name with path and how it should look like after your script has finished its work...
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
Re: Miscellaneous - Questions
These are original file names.
These are what I expect.
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
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
Re: Miscellaneous - Questions
It works perfect. Thank you!
Re: Miscellaneous - Questions
I'd like to know differences of these two regex.
Code: Select all
$newName = regexreplace($base, "\..*");
$newName = regexreplace($base, "\.[^.]+?$");
Re: Miscellaneous - Questions
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)
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
Re: Miscellaneous - Questions
Thank you for the explanations.
Re: Miscellaneous - Questions
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.)
(Status Bar when Full Screen Mode for preview images.)
Re: Miscellaneous - Questions
Because its so easy to tracking location and file names.
-
- Site Admin
- Posts: 60564
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: Miscellaneous - Questions
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.
FAQ | XY News RSS | XY Twitter