Tag Image with XML Tag
Hi All,
I want to tag all of my anchored images in a CS6 document with a particular XML Tag. I am using CS6 on Windows with JavaScript. Any advice would be appreciated. Thanks.
Rick
Hi All,
I want to tag all of my anchored images in a CS6 document with a particular XML Tag. I am using CS6 on Windows with JavaScript. Any advice would be appreciated. Thanks.
Rick
OK, it looks like I have to add the element to the structure and then use "markup" to apply the element to my image.
// Get the selected image.
var image = app.selection[0].getElements()[0];
// Get the Story element.
var root = doc.xmlElements.item(0);
var storyElem = root.xmlElements.item(0);
// Add the "Image" element to the Story element.
var imageElem = storyElem.xmlElements.add ("Image");
// Tag the selected image with the Image tag.
image.markup (imageElem);
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.