Adobe Bridge CC: Batch Rename using any metadata field
Copy link to clipboard
Copied
How can I add certain Metadata fields to the pull down menu in the batch rename function?
I need to do a batch rename of files, but using metadata fields that are not available as an option on the pull down menu.
Hoping to use any or all of these:
Audio : Artist, Album, Genre
IPTC Core : Description, Keywords, etc..
Copy link to clipboard
Copied
I don't think there is any way in which you can add to the built-in functions…
Unless this is actually provided by one of the Adobe start-up scripts… ( I've not see it when digging about )
You would probably need a scripted solution that can give you drop down menu of the extra options you want.
Copy link to clipboard
Copied
Hello,
I have the same request.
I am trying to use IPTC Core & Extension Data to batch rename many files on a regular basis.
It seems that most of the metadata available for batch renaming in bridge is read only. I need to enter a custom and very specific naming convention. I would be willing to use different files if necessary.
I also was wondering if its possible to create custom metadata and then use those fields to run a batch rename?
Any help is greatly appreciated.
Anthony
Copy link to clipboard
Copied
I just placed a feature request.
It would be nice if there was a Bridge script to do so though!
Bridge Batch Rename Using Any XMP Data | Photoshop Family Customer Community
Copy link to clipboard
Copied
This is easily done with Photo Mechanic... and probably one of the key reasons I'm using that software.
Sure would love to be able to batch rename using ANY of the IPTC fields, not just the fields provided in the dropdown menus.
I'd also like to insert Items such as "star rating" and "color rating" into the file name as well.
Has anyone found an answer to this? Seems like it should be possible.
Thanks.
Copy link to clipboard
Copied
Add your support to my request or make your own request:
Bridge Batch Rename Using Any XMP Data | Photoshop Family Customer Community
From a scripting perspective, I am sure that it is possible, however I am guessing that it is not an easy task (what to do if an image has blank metadata in the source field, how to handle metadata characters that are not legal for the operating system file name etc).
My solution is to use ExifTool
Copy link to clipboard
Copied
Hi I can't see this thread?
I need to add "Description" as one of the dropdown choices when batch re-naming using the Metadata option.
There seems to be lots of camera metadata as an option, but I would like to pull this from the IPTC core, and rename all photos, each having it's own unique description in the filename. Is this possible without an additional plug in? thank you!
Copy link to clipboard
Copied
Can you share a cropped screenshot of the batch rename window and type out the before and after filename example? I understand that you can only do so much in the screenshot perhaps use an EXIF field such as Aperture Value as a placeholder for the description metdata?
Copy link to clipboard
Copied
Yes, but then I'll have to change my lightroom plug ins to designate a different field for Description, which seems more complicated than adding a feild to the dropdown metadata menu in batch rename.
Also, my clients rely on Description to be just that in the metadata.
Please see attached screen shots
there is no option to choose the description field (in the dropdown menu) to be added to the filename. example: Recital2020.001_25_04_Dancers at the Barre
Recital2020.002_25_04_Dancer on Pointe
Recital2020.003_25_04_Finale
I can pull un sequential numbers and date, but not the unique description, as it is not an option regardless of how I set up the metadata in bridge.
thank you!
Copy link to clipboard
Copied
I just wanted to see how complex the rename structure was. In your screenshot photo of your screen the dropdown covers the other rename selections.
I didn't mean to change the field, this was just intended as a visual aid to see were the metadata would be inserted in the GUI.
If you use Lr, why don't you rename there?
So it appears that the description metadata would be:
Dancers at the Barre
Dancer on Pointe
Finale
I'm just an end user, we can't change how the batch rename is programmed. Which leaves work-arounds:
* A script to copy the description metadata to another unused metadata option that is available to the batch rename (ideally removing the temporary use of that other field after the rename with another script)
* A script to totally recreate the batch rename GUI with other metadata options
* Other software that is more flexibile, such as ExifTool
Copy link to clipboard
Copied
I might be able to offer help with a two step workflow:
1) You would use the batch rename tool to create the following structure:
Recital2020.001_25_04_.jpg
2) Then you would run a script that would append the description metadata at the end of the filename before the extension:
Dancers at the Barre
Recital2020.001_25_04_Dancers at the Barre.jpg
I'm only a beginner in scripting and most of my efforts are in Photoshop, not Bridge – so I can't promise that I can do this. I'll give it a go if there is interest from you.
Copy link to clipboard
Copied
The following code adds the description to the end of the base name (ensure that the base name has a separator character at the end such as an underscore _ or the script could be modified to do this if required).
/* https://community.adobe.com/t5/bridge/adobe-bridge-cc-batch-rename-using-any-metadata-field/td-p/6215682
https://www.ps-scripts.com/viewtopic.php?f=72&t=14282&p=89792&hilit=rename#p89787
Original script modified by Stephen Marsh 2021 */
#target bridge
if (BridgeTalk.appName == "bridge") {
RenDesc = new MenuElement("command", "Add Description to End of Filename", "at the end of tools");
}
RenDesc.onSelect = function () {
var sels = app.document.selections;
for (var z = 0; z < sels.length; z++) {
var thumb = sels[z];
var selectedFile = thumb.spec;
var baseName = selectedFile.name.replace(/[:\/\\*\?\"\<\>\|]/g, "_").replace(/(^.+)(\.[^\.]+$)/g, "$1");
var ext = selectedFile.name.replace(/[:\/\\*\?\"\<\>\|]/g, "_").replace(/(^.+)(\.[^\.]+$)/g, "$2");
md = new Thumbnail(selectedFile).synchronousMetadata;
md.namespace = "http://purl.org/dc/elements/1.1/";
Desc = md.description;
Desc = Desc.toString().replace(/[:\/\\*\?\"\<\>\|]/g, "_");
File(selectedFile).rename((baseName + Desc + ext));
}
}
Instructions for saving and installing here:
Downloading and Installing Adobe Scripts
Copy link to clipboard
Copied
You mistakenly put renaming outside 'for' loop closure.
Copy link to clipboard
Copied
Haha, such a basic mistake, thanks Kukurykus I have adjusted the code!
Copy link to clipboard
Copied
Help
I have tried this script, which works for the description field.
I would like to use the "User Comment" field (Nikon)
If I put it in in place of description in Desc=md.description; it errors because of the space
If I remove the space (or tried %) it does nothing
How do I get around this?
Copy link to clipboard
Copied
@Mark K Phillips – Can you provide a JPEG image with the Nikon User Comment metadata embedded in it?
Copy link to clipboard
Copied
I don't have any Nikon RAW files to test with, you'd have to find the namespace and extract that then use it to rename. Look under File Info->Raw data
Copy link to clipboard
Copied
Hi, thanks
It seems to be more than one line in the data
Copy link to clipboard
Copied
Thank you for the reply
For further background to this, we are looking at using a new bluetooth device called Entagged, which adds metadata from a barcode or QR, and we then want to use that data to rename the images.
Copy link to clipboard
Copied
Ideally an image with the metadata embedded, not an image of the metadata is needed.
Copy link to clipboard
Copied
That's a standard EXIF field.
The following script will add an underscore after the filename with the exif:UserComment field added at the end before the extension.
Example:
my-file.jpg
my-file_usercomment.jpg
/* https://community.adobe.com/t5/bridge/adobe-bridge-cc-batch-rename-using-any-metadata-field/td-p/6215682
https://www.ps-scripts.com/viewtopic.php?f=72&t=14282&p=89792&hilit=rename#p89787
Original script modified by Stephen Marsh 2022 */
#target bridge
if (BridgeTalk.appName == "bridge") {
RenusrCom = new MenuElement("command", "Add EXIF User Comment to End of Filename", "at the end of tools");
}
RenusrCom.onSelect = function () {
var sels = app.document.selections;
for (var z = 0; z < sels.length; z++) {
var thumb = sels[z];
var selectedFile = thumb.spec;
var baseName = selectedFile.name.replace(/[:\/\\*\?\"\<\>\|]/g, "_").replace(/(^.+)(\.[^\.]+$)/g, "$1");
var ext = selectedFile.name.replace(/[:\/\\*\?\"\<\>\|]/g, "_").replace(/(^.+)(\.[^\.]+$)/g, "$2");
md = new Thumbnail(selectedFile).synchronousMetadata;
md.namespace = "http://ns.adobe.com/exif/1.0/";
usrCom = md.UserComment;
usrCom = usrCom.toString().replace(/[:\/\\*\?\"\<\>\|]/g, "_");
File(selectedFile).rename((baseName + '_' + usrCom + ext));
}
}
https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html
Copy link to clipboard
Copied
Thanks Stephen
That works nicely, appreciate your help
Copy link to clipboard
Copied
I see that the namespace was the main issue for me, along with not knowing enough about scripting
Copy link to clipboard
Copied
Your welcome!
The File Info Raw Data gives a clue about the metadata entry, however, namespaces are much more cryptic.
The following is courtesy of Paul Riggott:
AEScart: => http://ns.adobe.com/aes/cart/
DICOM: => http://ns.adobe.com/DICOM/
Iptc4xmpCore: => http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/
Iptc4xmpExt: => http://iptc.org/std/Iptc4xmpExt/2008-02-29/
adhocwf: => http://ns.adobe.com/AcrobatAdhocWorkflow/1.0/
adobe: => http://ns.adobe.com/xmp/aggregate/1.0/
album: => http://ns.adobe.com/album/1.0/
as11c: => http://amwa.tv/mxf/as/11/core/
as11s: => http://ns.adobe.com/mxf/as/11/structural/
as11u: => http://amwa.tv/mxf/as/11/ukdpp/
asf: => http://ns.adobe.com/asf/1.0/
aux: => http://ns.adobe.com/exif/1.0/aux/
bext: => http://ns.adobe.com/bwf/bext/1.0/
bmsp: => http://ns.adobe.com/StockPhoto/1.0/
cq: => http://www.day.com/jcr/cq/1.0
creatorAtom: => http://ns.adobe.com/creatorAtom/1.0/
crs: => http://ns.adobe.com/camera-raw-settings/1.0/
custom_date: => http://ns.custom_date.com/custom_date/
dam: => http://www.day.com/dam/1.0
dc: => http://purl.org/dc/elements/1.1/
exif: => http://ns.adobe.com/exif/1.0/
exifEX: => http://cipa.jp/exif/1.0/
iX: => http://ns.adobe.com/iX/1.0/
iXML: => http://ns.adobe.com/ixml/1.0/
jp2k: => http://ns.adobe.com/jp2k/1.0/
jpeg: => http://ns.adobe.com/jpeg/1.0/
lr: => http://ns.adobe.com/lightroom/1.0/
pdf: => http://ns.adobe.com/pdf/1.3/
pdfaExtension: => http://www.aiim.org/pdfa/ns/extension/
pdfaField: => http://www.aiim.org/pdfa/ns/field#
pdfaProperty: => http://www.aiim.org/pdfa/ns/property#
pdfaSchema: => http://www.aiim.org/pdfa/ns/schema#
pdfaType: => http://www.aiim.org/pdfa/ns/type#
pdfaid: => http://www.aiim.org/pdfa/ns/id/
pdfe: => http://www.aiim.org/pdfe/ns/id/
pdfx: => http://ns.adobe.com/pdfx/1.3/
pdfxid: => http://www.npes.org/pdfx/ns/id/
photoshop: => http://ns.adobe.com/photoshop/1.0/
plus: => http://ns.useplus.org/ldf/xmp/1.0/
png: => http://ns.adobe.com/png/1.0/
rdf: => http://www.w3.org/1999/02/22-rdf-syntax-ns#
riffinfo: => http://ns.adobe.com/riff/info/
stCamera: => http://ns.adobe.com/photoshop/1.0/camera-profile
stDim: => http://ns.adobe.com/xap/1.0/sType/Dimensions#
stEvt: => http://ns.adobe.com/xap/1.0/sType/ResourceEvent#
stFnt: => http://ns.adobe.com/xap/1.0/sType/Font#
stJob: => http://ns.adobe.com/xap/1.0/sType/Job#
stMfs: => http://ns.adobe.com/xap/1.0/sType/ManifestItem#
stRef: => http://ns.adobe.com/xap/1.0/sType/ResourceRef#
stVer: => http://ns.adobe.com/xap/1.0/sType/Version#
swf: => http://ns.adobe.com/swf/1.0/
tiff: => http://ns.adobe.com/tiff/1.0/
wav: => http://ns.adobe.com/xmp/wav/1.0/
x: => adobe:ns:meta/
xapG: => http://ns.adobe.com/xap/1.0/g
xml: => http://www.w3.org/XML/1998/namespace
xmp: => http://ns.adobe.com/xap/1.0/
xmpBJ: => http://ns.adobe.com/xap/1.0/bj/
xmpCA: => http://ns.adobe.com/xmp/1.0/ContentAnalysis/
xmpDM: => http://ns.adobe.com/xmp/1.0/DynamicMedia/
xmpG: => http://ns.adobe.com/xap/1.0/g/
xmpGImg: => http://ns.adobe.com/xap/1.0/g/img/
xmpMM: => http://ns.adobe.com/xap/1.0/mm/
xmpNote: => http://ns.adobe.com/xmp/note/
xmpPMAssign: => http://xmlns.sony.net/pro/metadata/planningmetadata/assignment/
xmpPMMemo: => http://xmlns.sony.net/pro/metadata/planningmetadata/memo/
xmpRights: => http://ns.adobe.com/xap/1.0/rights/
xmpScript: => http://ns.adobe.com/xmp/1.0/Script/
xmpT: => http://ns.adobe.com/xap/1.0/t/
xmpTPg: => http://ns.adobe.com/xap/1.0/t/pg/
xmpidq: => http://ns.adobe.com/xmp/Identifier/qual/1.0/
xmpx: => http://ns.adobe.com/xmp/transient/1.0/
Copy link to clipboard
Copied
Using ExifTool, the following command can achieve this rename in a single step for a folder full of files:
exiftool -overwrite_original '-XMP-xmpMM:PreservedFileName<${filename}' '-filename<Recital2020.%1.3C_25_04_${XMP-dc:Description}.%le' '/system path to/top level/folder'
I have added faux syntax highlighting to help visually break up the command line code. The static text string is coloured in red. The remaining text in black is used to preserve the original filename in metadata, add a 3 digit sequential number starting at 1, add the description metadata and use a lowercase filename extension. The text coloured in blue is the file system path to the top-level folder or file being processed. This example is formatted for the Mac, Windows users would swap the single straight quote marks for double straight quote marks. Work on copies of the originals for safety until you are happy.
EDIT: I have updated the previous command line code to include the removal of illegal Windows filename characters:
exiftool -overwrite_original '-XMP-xmpMM:PreservedFileName<${filename}' '-filename<Recital2020.%1.3C_25_04_${XMP-dc:Description}.%le' -execute '-filename<${filename;s/[:\/\\*\?\"\<\>\|]//g}' -common_args '/system path to/top level/folder'


-
- 1
- 2