It works like a charm! Thanks boy for your help.
Now I need a beer to cool my brain and I want to offer a beer to you too! Thank you again.
Rename script
Re: Rename script
No problem and thanks for the beer
One of my scripts helped you out? Please donate via Paypal
Re: Rename script
Sometimes the script stops its run and it needs a second launch. Seems that if in the working folder there isn't files beginning for 0 it stops. In there a way to move on searching for the first number and beginning the rename work from there?
Code: Select all
$folder = "C:\Users\MN\Downloads\4S\1\";
$files = listfolder($folder, , 1+4, <crlf>);
$i = 0;
while ($i < 10) {
$selection = regexmatches($files, "^$i.*?(?=\r?\n|$)", <crlf>);
if ($selection) {
$j = 1;
foreach($item, $selection, <crlf>, "e") {
$number = format($j, "0000");
renameitem($i . $number, $folder . $item, 1);
$j++;
}
}
$i++;
}
Re: Rename script
Maybe I have solved it: the script beginns the rename work too soon: I have add the line "wait 2000;" and all seems OK
More eleganly, is there a way of tell the script to wait for the completion of the previous operation before going forward?
More eleganly, is there a way of tell the script to wait for the completion of the previous operation before going forward?