Site logo


Read/write 'Author Title' in the active document


function main() {
	var doc = app.activeDocument;
	var oldProperty = doc.metadataPreferences.getProperty("", "photoshop:AuthorsPosition");
	doc.metadataPreferences.setProperty("", "photoshop:AuthorsPosition", "My updated author title");

Read/write 'IPTC Contact - City' in the active document

var myDoc = app.activeDocument;
myDoc.metadataPreferences.setProperty("", "Iptc4xmpCore:CreatorContactInfo/Iptc4xmpCore:CiAdrCity", 'Kiev');
var cityStr = myDoc.metadataPreferences.getProperty("", "Iptc4xmpCore:CreatorContactInfo/Iptc4xmpCore:CiAdrCity");

Get profile of selected image

var link = app.selection[0].graphics[0].itemLink;
var linkXmp = link.linkXmp;
var profile = linkXmp.getProperty("", "ICCProfile");

Read width and height in pixels of the link

var myDoc = app.activeDocument;
var myLink = myDoc.allGraphics[0].itemLink;
var myLinkXmp = myLink.linkXmp;
var myLinkWidth = myLinkXmp.getProperty("", "tiff:ImageWidth");
var myLinkLength = myLinkXmp.getProperty("", "tiff:ImageLength");
alert("Pixel dimentions of the first link:\nWidth: " + myLinkWidth + " pixels\nHeight: " + myLinkLength + " pixels");

Indesign script to automatically insert document title metadata based on file name

Storing custom data into InDesign file via XMP

Extract Metadata with Adobe XMP [Part 1]

Extract Metadata with Adobe XMP [Part 2]

Extract file preview stored in Adobe XMP data

Fill InDesign XMP info from document content

Writing info to link´s metadata in InDesign

Write layer info in metadata in Photoshop

Metadata of links by Martin Fischer


Go back to the main InDesign code samples page