Hi all, I know that I can batch rename with something like "*-<#001>"
I want to write a script that batch rename the selected file in this format "<date yyyy-mm-dd-<#00n>", while the n is an interger from user input. Can you help me with this simple script?
Thank you!
Batch rename with autonumber that starts with a user input interger
-
- Posts: 12
- Joined: 16 Dec 2021 10:52
Re: Batch rename with autonumber that starts with a user input interger
Code: Select all
$date = <date yyyy-mm-dd>;
$i = input("Enter the start number incl. leading zeros!", , "001");
$len = strlen($i);
foreach($item, <get SelectedItemsNames>, <crlf>, "e") {
$num = format($i, strrepeat("0", $len));
renameitem($date . "-" . $num, $item);
$i++;
}
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de
Re: Batch rename with autonumber that starts with a user input interger
rename , '<date yyyy-mm-dd>-<#00' . input("Enter the start number",, 1) . '>';
-
- Posts: 12
- Joined: 16 Dec 2021 10:52
Re: Batch rename with autonumber that starts with a user input interger
Thank you both! Both codes work perfectly!