Copy link to clipboard
Copied
Hi!
I need to be able to read/write/modify the field "Job Identifier" through Javascript, but am unable to find the correct tag to do so. I have probably overlooked some obvious reference on the internet, but the only tag I can find that should be related to the ITPC is "activeDocument.info.JobID", and I am unable to get that to work (comes out as "undefined" even if there is data in the field "Job Identifier").
It would be immensely appreciated if anyone could provide a full list of IPTC javascript tags or otherwise guide me to a correct tag to use to solve my problem.
Thank you so much,
Edvard
It looks as if you can, here is a list..
app.activeDocument.info.author
app.activeDocument.info.caption
app.activeDocument.info.captionWriter
app.activeDocument.info.headline
app.activeDocument.info.instructions
app.activeDocument.info.keywords
app.activeDocument.info.author
app.activeDocument.info.authorPosition
app.activeDocument.info.credit
app.activeDocument.info.source
app.activeDocument.info.category
app.activeDocument.info.supplementalCategories
app.activeDocument.info.title
app.activeDocument.info.cre
...Copy link to clipboard
Copied
Have a look at this..
PS-Scripts/Populate IPTC Example.jsx at master · Paul-Riggott/PS-Scripts · GitHub
Copy link to clipboard
Copied
Hi SuperMerlin!
Thank you for the provided link - I am however unable to dechipher what I need from there..
What I think is relevant for me is line 37:
xmp.setProperty(XMPConst.NS_PHOTOSHOP, "TransmissionReference", "Job Identifier"); |
I am not sure however, and ideally I would access this through the way I access IPTC title, description and keywords;
activeDocument.info.title;
activeDocument.info.caption;
activeDocument.info.keywords;
I'm guessing there exist such a property - or am I missing something really obvious?
Copy link to clipboard
Copied
This is the way that you can modify any field...
#target photoshop;
if(documents.length){
if (ExternalObject.AdobeXMPScript == undefined) ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript");
xmp = new XMPMeta( app.activeDocument.xmpMetadata.rawData );
xmp.setProperty(XMPConst.NS_PHOTOSHOP, "TransmissionReference", "Job Identifier");
app.activeDocument.xmpMetadata.rawData = xmp.serialize();
}
Copy link to clipboard
Copied
It looks as if you can, here is a list..
app.activeDocument.info.author
app.activeDocument.info.caption
app.activeDocument.info.captionWriter
app.activeDocument.info.headline
app.activeDocument.info.instructions
app.activeDocument.info.keywords
app.activeDocument.info.author
app.activeDocument.info.authorPosition
app.activeDocument.info.credit
app.activeDocument.info.source
app.activeDocument.info.category
app.activeDocument.info.supplementalCategories
app.activeDocument.info.title
app.activeDocument.info.creationDate
app.activeDocument.info.city
app.activeDocument.info.provinceState
app.activeDocument.info.country
app.activeDocument.info.transmissionReference
app.activeDocument.info.copyrightNotice
app.activeDocument.info.ownerUrl
transmissionReference is the one you want.
Copy link to clipboard
Copied
Thank you so much! This will help me immensely!
I hope you will have a fantastic day!
Edvard
Copy link to clipboard
Copied
@SuperMerlin
Any idea how to set one of these to ""? I can only seem to add data note take it away. .remove(), .delete(), null and undefined aren't working as a test.
//This doesn't erase existing recorded titles
Copy link to clipboard
Copied
Unfortunately, @SuperMerlin is no longer active on the forums.
To remove the Document Title for an open file, try the following function:
#target photoshop
removeTitle();
function removeTitle() {
if (!documents.length) return;
if (ExternalObject.AdobeXMPScript === undefined) ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript");
var xmp = new XMPMeta(activeDocument.xmpMetadata.rawData);
XMPUtils.removeProperties(xmp,XMPConst.NS_PHOTOSHOP, "Title", XMPConst.REMOVE_ALL_PROPERTIES);
app.activeDocument.xmpMetadata.rawData = xmp.serialize();
}
To batch remove the Document Title from an entire folder of supported images (add or remove file type extensions in the code as required):
// https://forums.adobe.com/message/9671488#9671488
// https://forums.adobe.com/message/10576150#10576150
#target photoshop;
var inputFolder= Folder.selectDialog ("Please select folder to process");
if(inputFolder != null){
var fileList = inputFolder.getFiles(/\.(jpg|jpeg|tif|tiff|psd|psb|png|webp)$/i);
for(var a in fileList){delDocTitle(fileList[a]);}
}
function delDocTitle(selectedFile) {
if (ExternalObject.AdobeXMPScript == undefined) ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript");
var xmpFile = new XMPFile( selectedFile.fsName, XMPConst.FILE_UNKNOWN, XMPConst.OPEN_FOR_UPDATE | XMPConst.OPEN_USE_SMART_HANDLER );
var xmp = xmpFile.getXMP();
xmp.deleteProperty(XMPConst.NS_PHOTOSHOP, "Title");
if (xmpFile.canPutXMP(xmp)) {
xmpFile.putXMP(xmp);
xmpFile.closeFile(XMPConst.CLOSE_UPDATE_SAFELY);
}
};
Copy link to clipboard
Copied
Thanks! I'm trying to batch this through bridge, and now noticing for Illustrator files there are additional persistent titles stored in meta aside from Document Title. Is there a way to access title here? I'm guessing this is part of postscript/pdf... Sample below:
%!PS-Adobe-3.0
%%Creator: Adobe Illustrator(R) 24.0
%%AI8_CreatorVersion: 28.0.0
%%For: (USER_NAME) ()
%%Title: (OLD_FILENAME.ai)
%%CreationDate: 11/15/23 9:12 PM
%%Canvassize: 16383
%%BoundingBox: -431 -586 1300 944
For clarifications, I'm using the AddFilenameToTitle() you referenced here:
https://community.adobe.com/t5/bridge-discussions/bridge-script-to-write-filename-to-description-cre...
Copy link to clipboard
Copied
I'm going out on a limb and guessing that this is outside of standard legacy/XMP metadata.
Can you provide a link to a sample file? Where are you viewing this data?
If anything can do it, it would be ExifTool, but that may also have limitations.
Copy link to clipboard
Copied
Sure! Attached an Illustrator PDF, because ai wouldn't go through. "!PS-Adobe-3.0" only occurs once when opening this up in text edit on mac, to help you navigate through the raw data. Interestingly, I created this file with the title "metaSample" and saved it as "2345originalSampleTEST.ai", then PDF, but even Illustrator didn't revise this title on save to AI, only PDF. I only learned it existed today because AEM reads it in.
Copy link to clipboard
Copied
It actually may be another tag toward the bottom:
<</CreationDate(D:20231116153808-05'00')/Creator(Adobe Illustrator 28.0 \(Macintosh\))/ModDate(D:20231116153809-05'00')/Producer(Adobe PDF library 17.00)/Title(2345originalSampleTEST)>>
Copy link to clipboard
Copied
Thanks! I'm trying to batch this through bridge
By @wckdTall-2
This is the Photoshop forum, not Bridge, so solutions posted here are usually for Photoshop.
I have added a script to the topic in the Bridge forum that you mentioned:
Copy link to clipboard
Copied
Thanks for this. Both worked well!
Out of curiosity, the removed title only has a closing alt tag is that an issue?
<dc:title>
<rdf:Alt/>
</dc:title>
Vs a regular title tag:
<dc:title>
<rdf:Alt>
<rdf:li xml:lang="x-default">TITLE</rdf:li>
</rdf:Alt>
</dc:title>
I ended up implementing this syntax for my Photoshop scripts to remove title:
tgtDoc = app.activeDocument;
if (!documents.length) return;
if (ExternalObject.AdobeXMPScript == undefined) ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript");
var xmp = new XMPMeta(tgtDoc.xmpMetadata.rawData);
xmp.deleteProperty(XMPConst.NS_PHOTOSHOP, "Title");
tgtDoc.xmpMetadata.rawData = xmp.serialize();