Skip to main content
edvardkrupke
Known Participant
May 21, 2019
Answered

Modifying IPTC "Job Identifier" through Javascript?

  • May 21, 2019
  • 1 reply
  • 2576 views

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

This topic has been closed for replies.
Correct answer SuperMerlin

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(); 

}


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.

1 reply

SuperMerlin
Inspiring
May 21, 2019
edvardkrupke
Known Participant
May 21, 2019

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?

_wckdTall_
Inspiring
November 14, 2023

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.


@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

app.activeDocument.info.title  = ""

//This adds the title no problem
app.activeDocument.info.title = "TEST";