rename pictures by IPTC
Helo i need compose apple script for rename selected pictures in capture one. For new name of photos i need automaticaly use title value from iptc.
from chatGPT I get this:
tell application "Capture One 23"
activate
set selectedPhotos to selection
repeat with photo in selectedPhotos
tell photo
set titleValue to value of IPTC field "title"
set name of photo to titleValue
end tell
end repeat
end tell
But not working.
Anybody got any ideas on how to do that?
Thanks Tomas
-
It would be very helpful to know what the script does do when it runs.
Are there any error messages in the log, and what are they.
Does the script run to the end or stop with an error? Which error?
Can you put in a notification or counter to determine if the while loop is executed?
What happens when you display the value of “titlevalue”0 -
Walter has clearly identified one of the problems, and that this will rename the file.
0 -
Very interesting that you managed to get this far with GPT!!
If the status title is empty you might want to account for that with a if condition.
If photo’s status title is not “” then
Do rename
end if0 -
Hello and thank you all for your interest.
Yes, renaming a file ( name change ) to the same name as the value specified on the title line in iptc is exactly what I need.
In my case, it is probably desirable that if the title value is empty, do nothing and jump to the next file.The thing is, I have photos with the title value filled in in iptc and I need them to have the same name.
I get syntax eror in Script editor { see pic }
I enclose a screenshot of what I would like to achieve ( of course on a selection of many photos at once )
Thank you for your patience
Tomas0 -
Great, thank you very much, I will definitely try.
Thanks for the clarification and patience.
Have a nice day.
Tomas Vrtal0 -
Not to be a party pooper but if you have the IPTC field already filled in, then you can just use Batch rename with the appropriate token. Scripting this is totally unnecessary.
0 -
Yes and no, if I only need a name after export, then yes.
No, because I need a more complicated output. I guess I have to explain it more.
The resulting photos is:
1] a watermark / derived from the title value and created after export in an external program, because capture one does not know a watermark on a white background / which is common for multiple views of one object.
2] and has a unique filename / the base is usually title + sufix / which is uniqe for each view of one object.This way I can write the title, with script rename the mastery photos, add only a suffix, export, add a watermark by batch.
Because in this particular workflow I only work with mastry and not variants, I slightly simplified the walter script and now it works exactly as I needed.
tell application "Capture One 23"
activate
set selectedPhotos to get variants where selected is true
set lastParent to ""
repeat with photo in selectedPhotos
set photo's parent image's name to photo's status title
set lastParent to photo's parent image
end repeat
end tell
thanks a lot to everyone for help /specialy Walter Rowe/ and maybe it will be useful for someone.
Tomas Vrtal0 -
Maybe I missed something but all the script does is the same as Batch Rename on the "mastery" photos... ?
0 -
Description "title" is only the base for the file name, then I edit it /add user index, suffix etc./ and if I do it in the capture one environment I can then export to the target formats /tiff, jpg. raw/ with the correct name.
If I did it with batch rename I would then have to add user data /index, suffix etc./ to each export /tiff, jpg. raw/ especially.
Maybe I describe it awkwardly :-)
T.0
Please sign in to leave a comment.
Comments
9 comments