Yes you can do that.
But make that sense?
Maybe better shorten the string with some tricks like 1-4a Renamer does?
Like
* delete unnecessary spaces after brackets
* abbreviate parts of the file name
* NoSpaceBetweenLetters
* No doubles: Madonna > Madona
* Kill Vowels
Anyway, if you want you can try this
test script on an handful testfiles first :
Code: Select all
foreach($Item, <get SelectedItemsNames |>) {
msg $Item,1;
$NewFilename = substr($Item,0,96);
if( strlen($NewFilename) < strlen($Item)){
msg "$NewFilename + Original ext",1;
rename b, "$NewFilename", p, "<curpath>\$Item";
}else{
msg "Nothing to do.";
}
}
* get SelectedItemsNames will get all selected file names
* foreach(){} will loop over all files in the array
* substr() will take an part of the string
* rename will rename (while keeping the original extension in this shown setup)
and preview you each file before actual renaming ("p").
* since we have gotten the file names without the path,
we have to use smtg like
"<curpath>\$Item"; for the rename command
(While the newname-part works on the current folder, the currentName-part does not and can not find $Item alone. Don?)
Read the help "Scripting Commands Reference" for more.
Hint: if you Cancel the rename preview, you will see the
XYplorer scripting window (click)
EDIT: good idea with checking if the new string is shorter then the original, highend! Changed mine too.