I need to get the document title for the active document (a photo) in Photoshop CS. I have pieced together the following code which runs but does not give me what I want. How do I reference the active Photoshop document and get its title. Thanks.
#target photoshop
// load the library
if (ExternalObject.AdobeXMPScript == undefined) {
ExternalObject.AdobeXMPScript = new ExternalObject('lib:AdobeXMPScript');
}
xmpRef = new XMPMeta();var xmpMetaRef = new XMPMeta();
var docTitle = xmpRef.getProperty(XMPConst.NS_IPTC_CORE, "Title");
alert(docTitle);