Hello,
I tried XYP and I see it very useful for me,
I need enhace this feature:
when renaming some video files with Chinese and Rusian characters in filename. Many times the result is: ".mp4" (all chars was removed) and with more files like that same are not renamed.
It is possible to add into this dialog box a [x] check box that append automaticaly numbering to such cases (for duplicate filenames only)?
So if I have more expected results as:
".mp4"
it will produce:
"(1).mp4"
"(2).mp4"
"(3).mp4"
...etc.
Otherwise it needs one more renaming before processing this (as stated above).
Thank you. Radim
Special renaming box - missing add numberring (1) if the same name after renaming
Re: Special renaming box - missing add numberring (1) if the same name after renaming
What not using a script...
Works on all selected files...
Works on all selected files...
Code: Select all
$index = 1;
foreach($item, <get SelectedItemsPathNames |>, , "e") {
$name = trim(replace(RemoveUnicode(gpc($item, "base")), "¤"));
$ext = gpc($item, "ext");
if ($name == "") {
$name = "($index)." . $ext;
$index++;
} else {
$name = $name . "." . $ext;
}
renameitem($name, $item);
}
function RemoveUnicode($string) {
$newString = "";
$len = strlen($string);
while ($i++ < $len) {
$ascii = Asc(gettoken($string, $i, ""));
if ($ascii >= 256) { $char = "¤"; }
else { $char = chr($ascii); }
$newString .= $char;
}
return $newString;
}
One of my scripts helped you out? Please donate via Paypal
Re: Special renaming box - missing add numberring (1) if the same name after renaming
Thanks, how to install it as icon on toolbar? I am new to XYP.highend wrote: ↑31 May 2019 11:43 What not using a script...
Works on all selected files...Code: Select all
$index = 1; foreach($item, <get SelectedItemsPathNames |>, , "e") { $name = trim(replace(RemoveUnicode(gpc($item, "base")), "¤")); $ext = gpc($item, "ext"); if ($name == "") { $name = "($index)." . $ext; $index++; } else { $name = $name . "." . $ext; } renameitem($name, $item); } function RemoveUnicode($string) { $newString = ""; $len = strlen($string); while ($i++ < $len) { $ascii = Asc(gettoken($string, $i, "")); if ($ascii >= 256) { $char = "¤"; } else { $char = chr($ascii); } $newString .= $char; } return $newString; }
Re: Special renaming box - missing add numberring (1) if the same name after renaming
Menu - Tools - Customize Toolbar...
Add a "User Button #<x>" from the left side to the right side
Right click that new button in the toolbar, "Edit..."
"Edit..." button at the right side "On left click", paste the script in that new window...
Add a "User Button #<x>" from the left side to the right side
Right click that new button in the toolbar, "Edit..."
"Edit..." button at the right side "On left click", paste the script in that new window...
One of my scripts helped you out? Please donate via Paypal
Re: Special renaming box - missing add numberring (1) if the same name after renaming
Hmm, I did as you recomend, but when click on button with selected files nothing happens.
Re: Special renaming box - missing add numberring (1) if the same name after renaming
Use the script of my previous post again, I made a small update to it...
One of my scripts helped you out? Please donate via Paypal