Miscellaneous - Questions
-
MaxEnrik
- Posts: 107
- Joined: 20 Apr 2019 02:34
Re: Miscellaneous - Questions
Thank you for the key words! I'll do.
-
MaxEnrik
- Posts: 107
- Joined: 20 Apr 2019 02:34
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);
}-
highend
- Posts: 14926
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
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
-
MaxEnrik
- Posts: 107
- Joined: 20 Apr 2019 02:34
Re: Miscellaneous - Questions
The problem still the same and stays.
-
highend
- Posts: 14926
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
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
-
MaxEnrik
- Posts: 107
- Joined: 20 Apr 2019 02:34
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].mkvThese are what I expect.
Code: Select all
Soundtrack final __ promo.mp3
DESIGN Title sequence Part.3 __ Edition Universe.mkv-
highend
- Posts: 14926
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
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
-
MaxEnrik
- Posts: 107
- Joined: 20 Apr 2019 02:34
Re: Miscellaneous - Questions
It works perfect. Thank you!
-
MaxEnrik
- Posts: 107
- Joined: 20 Apr 2019 02:34
Re: Miscellaneous - Questions
I'd like to know differences of these two regex.
Code: Select all
$newName = regexreplace($base, "\..*");
$newName = regexreplace($base, "\.[^.]+?$");-
highend
- Posts: 14926
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
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
-
MaxEnrik
- Posts: 107
- Joined: 20 Apr 2019 02:34
Re: Miscellaneous - Questions
Thank you for the explanations.
-
MaxEnrik
- Posts: 107
- Joined: 20 Apr 2019 02:34
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.)
-
admin
- Site Admin
- Posts: 66102
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
-
MaxEnrik
- Posts: 107
- Joined: 20 Apr 2019 02:34
Re: Miscellaneous - Questions
Because its so easy to tracking location and file names.
-
admin
- Site Admin
- Posts: 66102
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @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 X
XYplorer Beta Club