Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects After Effects reading XMP image data via scripting

  • After Effects reading XMP image data via scripting

    Posted by Tim Smith on August 4, 2015 at 1:02 am

    Looking for information or good resources to learn more about scripting After Effects to read XMP image information?

    I’ve read the XMP sections in the Extendscript Javascript Tools Guide and I am still struggling with accessing the info via AE scripting.

    Any help/pointers would be greatly appreciated.

    Walter Soyka replied 11 years, 1 month ago 2 Members · 5 Replies
  • 5 Replies
  • Tim Smith

    August 5, 2015 at 12:52 am

    Thanks for the reply Dave.

    The idea is to access camera information from images and use it later as a variable within the script.
    I know that the information is there as I can see it in PS/Bridge.

    I’ll post the same question that I asked over on AE forums just in case you have any thoughts about it:

    —–From AE Forum—————–
    I’ve been trying to get the code below to work and it keeps throwing an error “Undefined is not an object.”

    if (ExternalObject.AdobeXMPScript == undefined) {
    ExternalObject.AdobeXMPScript = new ExternalObject('lib:AdobeXMPScript');
    }
    var metaFile = File.openDialog("Select file to import");
    var xmpFile = new XMPFile(metaFile.fsName, XMPConst.FILE_UNKNOWN, XMPConst.OPEN_FOR_READ);
    var xmp = xmpFile.getXMP();
    alert(xmp.getProperty(XMPConst.NS_TIFF, "Model").toString()); //throws error "Undefined is not an object"
    xmpFile.closeFile();
    metaFile.close();

    Is there something key missing or that I don’t understand?
    ———————-

    Thanks in advance for your help.

  • Walter Soyka

    August 5, 2015 at 1:43 am

    getProperty() should return undefined when the property isn’t found. Any chance you can post a sample image file so we can play along?

    Walter Soyka
    Designer & Mad Scientist at Keen Live [link]
    Motion Graphics, Widescreen Events, Presentation Design, and Consulting
    @keenlive   |   RenderBreak [blog]   |   Profile [LinkedIn]

  • Tim Smith

    August 5, 2015 at 2:06 am

    Thanks Walter.

    Here’s a sample image taken on iPhone that I’m playing with:
    https://dl.dropboxusercontent.com/u/44182853/IMG_5351.JPG

    I’m giving this another shot today too, hope I can get it going.

    Let me know how you go 🙂

  • Tim Smith

    August 5, 2015 at 2:50 am

    So this is embarrassing…

    Seams that after a rebooting and running this script again this morning (in Australia) it’s working.

    Something must have been stuck in memory somewhere because I ran this exact same script yesterday on the same file and it threw back undefined every single time. Even after restarting AE and Extendscript multiple times.

    Now it’s returning the camera model like it’s suppose to.

    Rather annoying waste of time but good that the script works now!

    Thanks for being willing to help guys. Sorry if I’ve wasted your time.

    Cheers, Tim

  • Walter Soyka

    August 5, 2015 at 1:26 pm

    Glad you’re sorted.

    Walter Soyka
    Designer & Mad Scientist at Keen Live [link]
    Motion Graphics, Widescreen Events, Presentation Design, and Consulting
    @keenlive   |   RenderBreak [blog]   |   Profile [LinkedIn]

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy