Copy link to clipboard
Copied
Hi,
can someone help me please:
How can I extract (or read) the "Credit" and the "Source" value from Metadata in Bridge CC2015+ for all possible image file formats with Javascript?
(At the best without exiftool)
Any help would be greatly appreciated.
Example to be run from Extendscript Toolkit.
...#target bridge;
var thumbs = app.document.visibleThumbnails;
//file types to process
thumbs = app.document.getSelection("jpg,tif,gif,eps,psd,pcx,png,eps,crw,cr2,tiff,raw,rw2,dng,nef,orf,erf,mos,dcr,raf,srf,pef,x3f");
for(var a in thumbs){
var thumb = thumbs;
md = thumb.synchronousMetadata;
md.namespace = "http://ns.adobe.com/photoshop/1.0/";
var filename = decodeURI(thumbs.name);
var Credit = md.Credit ? md.Credit : "" ;
var Source = md.Source ? md.Source : ""
Copy link to clipboard
Copied
Example to be run from Extendscript Toolkit.
#target bridge;
var thumbs = app.document.visibleThumbnails;
//file types to process
thumbs = app.document.getSelection("jpg,tif,gif,eps,psd,pcx,png,eps,crw,cr2,tiff,raw,rw2,dng,nef,orf,erf,mos,dcr,raf,srf,pef,x3f");
for(var a in thumbs){
var thumb = thumbs;
md = thumb.synchronousMetadata;
md.namespace = "http://ns.adobe.com/photoshop/1.0/";
var filename = decodeURI(thumbs.name);
var Credit = md.Credit ? md.Credit : "" ;
var Source = md.Source ? md.Source : "" ;
$.writeln(filename + "," +Credit + "," + Source);
}
Copy link to clipboard
Copied
really does live up to its name!
Great. That's 9 out of a possible 10 points.
Thank you very much.
But unfortunately it does not work with *.bmp and *.pcx --> thumbs = app.document.getSelection("bmp,pcx"); //"undefined is not an object"
Copy link to clipboard
Copied
Do these file types support this metadata? The Bridge Metadata panel GUI would appear to suggest that this is not possible.
ExifTool has issues with BMP too. Using the following command:
exiftool -XMP-photoshop:Credit=ABC -XMP-photoshop:Source=123 '/Users/currentuser/Desktop/test.bmp'
Has the following error: “Error: Writing of BMP files is not yet supported, 0 image files updated, 1 files weren’t updated due to errors”
And as for PCX: “Error: Writing of this type of file is not supported, 0 image files updated, 1 files weren’t updated due to errors”
Copy link to clipboard
Copied
As Steven has said bmp and pcx are not supported for metadata in Bridge, if you try to use Info, it is not available. You won't need to check these file types as you now know there is nothing there
Copy link to clipboard
Copied
Thank you both of you for the quick responses.