how can add the max space possible then modified date to multiply files with different file length ?

Advanced Renamer forum
#1 : 04/02-19 03:55
MOOOOOOOON
MOOOOOOOON
Posts: 4
i was about to use this command
https://i.ibb.co/6gWJYnr/image.png
then i remembered that not all may files have the same name length....
how can i fix this ?
what i want to do is
<Name><maxspacepossible><Year Modified><Month Modified><Day Modified>


04/02-19 03:55
#2 : 04/02-19 17:34
David Lee
David Lee
Posts: 1125
Reply to #1:
I'm not sure exactly what you are hoping to achieve. If I understand correctly then it would appear to be a totally stupid idea!

What do you mean by maxspacepossible? NTFS filenames themselves are limited to a maximum length of 255 characters, however the Windows API imposes a limit of 260 characters for the complete path string.

ARen will warn you if you try to exceed the 255 character filename limit but if the overall path length is too long then it will not show any warning but will throw a system Error 101 at runtime when it tries to rename the file.

If your idea is simply to add spaces to make all the filenames the same length then you can easily accomplish this using a script, by adding an appropriate number of spaces between the name and date.

To pad filenames with spaces to a total length of 25 characters you can use the following script:

var maxLength = 25;
var name = item.name;
var date = app.parseTags("<Year Modified><Month Modified><Day Modified>");
var numSpaces = maxLength - name.length - date.length;
var spaces = "";
for (i = 0; i < numSpaces; i++) spaces += " ";
return name + spaces + date;



04/02-19 17:34 - edited 04/02-19 17:36
#3 : 05/02-19 00:44
MOOOOOOOON
MOOOOOOOON
Posts: 4
Reply to #2:

"If your idea is simply to add spaces to make all the filenames the same length"
yes this what i am trying to do and finally someone replied me with great reply...

but
i got this error
https://i.ibb.co/PtYx4RD/image.png

BTW does these spaces Include the file extension..... and i want the filename+spaces=211 characters
so that the filename+spaces+4 spaces+<Year Modified><Month Modified><Day Modified>+file extension=227

thanks for your kind



05/02-19 00:44 - edited 05/02-19 00:48
#4 : 05/02-19 07:56
David Lee
David Lee
Posts: 1125
Reply to #3:
Try entering ALL the lines in the script I gave you!

The script sets the length of the name only. It should be obvious how to include the extension if I tell you that item.ext will return the extension, including the dot.

Be aware that if you set the filename +extension to 227 characters then the rest of your file path including volume name must be shorter than 33 characters otherwise Windows will throw an error when you run the batch.

Please explain why you want to add so many spaces in the middle of your filenames- it seems a very stupid thing to want to do!



05/02-19 07:56
#5 : 07/02-19 23:18
MOOOOOOOON
MOOOOOOOON
Posts: 4
Reply to #4:
"filename +extension to 227 characters"
not a problem


"Please explain why you want to add so many spaces in the middle of your filenames- it seems a very stupid thing to want to do!"
because i don't want the modified name to be visible in the filename unless i expand the names column .... that's why.....

"Try entering ALL the lines in the script I gave you!" thanks it works now !


07/02-19 23:18
#6 : 07/02-19 23:18
MOOOOOOOON
MOOOOOOOON
Posts: 4
Reply to #5:
"Please explain why you want to add so many spaces in the middle of your filenames- it seems a very stupid thing to want to do!"
it just a appearance and organization thing


07/02-19 23:18 - edited 07/02-19 23:19