Help with a script
Help with a script
I need help in creating a script that renames my pictures according to the following diagram:
download/file.php?mode=view&id=14821
Thank you
download/file.php?mode=view&id=14821
Thank you
- Attachments
-
- Automating selected files renaming.jpg (51.45 KiB) Viewed 1415 times
Re: Help with a script
?from a dropdown menu of selected names
One of my scripts helped you out? Please donate via Paypal
Help with a script
This is group of 15 to 20 names that remain unchanged when the script is applied to the jpgs of a different folder.
Re: Help with a script
I don't get it. Maybe someone else does...
One of my scripts helped you out? Please donate via Paypal
Re: Help with a script
he needs a script to rename images in folder by pattern:
[folder name]*space*name_picked_from_list
*name_picked_from_list =list of 15-20 strict specified names, kinda like tags. each cycle of script asks to pick one of names from list, for image currently under rename.
[folder name]*space*name_picked_from_list
*name_picked_from_list =list of 15-20 strict specified names, kinda like tags. each cycle of script asks to pick one of names from list, for image currently under rename.
Win 7 SP1 x64 100% 1366x768
Re: Help with a script
No, what I was wondering about is:
If this is not what you wanted, I'm out.
Ofc they are not changed, only items in the destination folder are to be renamed...This is group of 15 to 20 names that remain unchanged
If this is not what you wanted, I'm out.
Code: Select all
end (<get countselected> == 0), "No item(s) selected, aborted!";
$dstFolder = inputfolder(, "Choose folder where the .jpg(s) reside");
$jpgFiles = listfolder($dstFolder, "*.jpg", 1+4, <crlf>);
end (!$jpgFiles), "No .jpg file(s) found in destination folder, aborted!";
$menu = regexreplace(<get SelectedItemsNames <crlf>>, "^(.+?)(\.[^.]+?)(?=\r?\n|$)", "$1");
foreach($jpgFile, $jpgFiles, <crlf>, "e") {
$tmpMenu = "Suffix for $jpgFile<crlf>-<crlf>" . $menu;
$suffix = popupmenu($tmpMenu, 6:=<crlf>, 7:="|");
if (strpos($suffix, "suffix for") != -1) { continue; }
$prefix = gettoken($dstFolder, -1, "\");
renameitem("$prefix $suffix", $jpgFile, 1, "-01");
}
One of my scripts helped you out? Please donate via Paypal
Re: Help with a script
Thank you for your reply.
Sorry my ignorance, but what type of file is SelectedItemsNames? Is it a text file that I have to create in the same folder where the jpgs' to be renamed are located? Is it a db file?
Sorry my ignorance, but what type of file is SelectedItemsNames? Is it a text file that I have to create in the same folder where the jpgs' to be renamed are located? Is it a db file?
Re: Help with a script
it's a command that gathers names of all selected files.
Win 7 SP1 x64 100% 1366x768
Re: Help with a script
I am assuming the names I want to use to rename the jpgs are contained in a txt or db file in the same folder where the jpgs' are located. My question was: which type of file shall the names be stored in, so as to be picked up by the SelectedItemsNames command ?
Re: Help with a script
Selected names^^
You select the files you want to use as names for the .jpgs (in a different folder) and then you start the script...
You select the files you want to use as names for the .jpgs (in a different folder) and then you start the script...
One of my scripts helped you out? Please donate via Paypal
Re: Help with a script
Thank you. The script works as per my functional diagram.
However, my objective was not totally reflected in it. A minor variation I would like to introduce is the possibility of skipping renaming of some of the jpgs when the script runs through them. Is it possible to achieve it by a small modification of the script?
However, my objective was not totally reflected in it. A minor variation I would like to introduce is the possibility of skipping renaming of some of the jpgs when the script runs through them. Is it possible to achieve it by a small modification of the script?
Re: Help with a script
Not with a popup menu...
This would work with skipped files:
This would work with skipped files:
Code: Select all
end (<get countselected> == 0), "No item(s) selected, aborted!";
$dstFolder = inputfolder(, "Choose folder where the .jpg(s) reside");
$prefix = gettoken($dstFolder, -1, "\");
$jpgFiles = listfolder($dstFolder, "*.jpg", 1+4, <crlf>);
end (!$jpgFiles), "No .jpg file(s) found in destination folder, aborted!";
$menu = regexreplace(<get SelectedItemsNames <crlf>>, "^(.+?)(\.[^.]+?)(?=\r?\n|$)", "$1");
foreach($jpgFile, $jpgFiles, <crlf>, "e") {
$suffix = inputselect("Suffix for $jpgFile", $menu, <crlf>, 4+32+4096+8192+16384, "not_named", 400, 600);
if ($suffix LikeI "not_named") { continue; }
renameitem("$prefix $suffix", $dstFolder . "\" . $jpgFile, 1, "-01");
}
One of my scripts helped you out? Please donate via Paypal
Re: Help with a script
The script is interrupted in line 4
- Attachments
-
- Script execution error.png (34.37 KiB) Viewed 1366 times
Re: Help with a script
Copy the script a second time and do it again
One of my scripts helped you out? Please donate via Paypal
Re: Help with a script
Wow, it works. Thank you very much, it will save me tons of time.