Hi, thank you so much for your time and your effort and hard work, i really appreciate your help
but i still have problems 😕😕
like in the screenshot i have a bunch of files in a bunch of different folder, it can be 2 folder some days or maybe 200 it depends of the work charge we have, when there is 2 its ok i have a semi automatic way of renaming the files but 200 takes a long time to do. ( I can rename the files in a folder automatically with a command with my wacom tablet but i still have to select the folders manually )
Your script works but only for one folder and it start the first file with "-02"
Do you have a way i could do this automatically for all the files in all the folders that are in "01_EN COURS" ?
The folder are already rename, i just need the files to have the folder's name with a sequence startint from "-01" and reseting between folders
rnmng = new MenuElement('command', 'Renaming of Files',
'at the end of Thumbnail'), rnmng.onSelect = function() {
fnctn = function(v){return v instanceof Folder}
fldrs = app.document.thumbnail.spec.getFiles(fnctn)
while(fldrs.length) {
lngth = (fls = (fldr = fldrs.shift())
.getFiles('*.tif')).length; while(fls.length)
fls.shift().rename(fldr.name + '-' + ('0'
+ (lngth - fls.length)).slice(-2) + '.tif')
}
}