7 Replies Latest reply on Dec 3, 2008 10:57 AM by (Olav_Kvern)

    Image link reference?

      Hello,

      does anybody know how can i find full reference of link object properties for itemLink?

      For now I know properties like:
      - name
      - filePath
      - linkXmp.description
      - linkXmp.author

      are there more?
      is there a way to get the raw data from XMP?
      is there a way to get link dimentions (original)?

      bye
      maczor
        • 1. Re: Image link reference?
          Kasyan Servetsky Level 5
          >is there a way to get the raw data from XMP?

          >is there a way to get link dimentions (original)?

          If you mean to get a link's metadata info from Advanced panel in PS (File > File Info...), here is an example:
          var myDoc = app.activeDocument;
          
          var myLink = myDoc.allGraphics[0].itemLink;
          var myLinkXmp = myLink.linkXmp;
          var myLinkWidth = myLinkXmp.getProperty("http://ns.adobe.com/tiff/1.0/", "tiff:ImageWidth");
          var myLinkLength = myLinkXmp.getProperty("http://ns.adobe.com/tiff/1.0/", "tiff:ImageLength");
          alert("Pixel dimentions of the first link:\nWidth: " + myLinkWidth + " pixels\nHeight: " + myLinkLength + " pixels");
          • 2. Re: Image link reference?
            Kasyan Servetsky Level 5
            P.S. I assume that the link is a Tif file.
            • 3. Re: Image link reference?
              Level 1
              Great, thx a lot

              but how did you know that?
              is there any reference guide for InDesign javascript?

              and one more thing: let's assume it's not a TIFF, is there a way to do same thing for EPS, PDF and PSD?
              • 4. Re: Image link reference?
                Kasyan Servetsky Level 5
                >but how did you know that?

                I found it experimentally.

                >is there any reference guide for InDesign javascript?

                Yes.
                http://www.adobe.com/products/indesign/scripting/index.html
                See Scripting resources section.

                >is there a way to do same thing for EPS, PDF and PSD?

                Yes.
                I use the following approach: open a file in PS, then go to File > File Info > Advanced, then click a triangle. To the right of it you see a namespace and below it you see pathes of this namespace.
                Then I look for the property I need.
                And finally I use the getProperty method of LinkMetadata object to get it in InDesign.
                myLink.myLinkXmp.getProperty(namespace, path);
                • 5. Re: Image link reference?
                  Level 1
                  maczor@adobeforums.com wrote:

                  > and one more thing: let's assume it's not a TIFF, is there a way to do same thing for EPS, PDF and PSD?

                  It doesn't matter if it's a tiff file or not (in the general case). 'tiff' is
                  just the de facto namespace where these properties can be found.

                  > but how did you know that?
                  Kasyan gave you a link for the JS part.

                  For the XMP stuff:
                  Adobe has published a set of XMP Specification docs and guides. These are very
                  helpful. Google is your friend.

                  The site for exiftool (and the tool itself) will provide you with more info than
                  you could ever want about metadata.

                  And I have some code here that you might find useful for working with XMP data:
                  http://ps-scripts.cvs.sourceforge.net/viewvc/*checkout*/ps-scripts/xtools/xlib/XMPNameSpac es.jsx

                  -X
                  • 6. Re: Image link reference?
                    Level 1
                    thank you both, it was quick and gave me enough info to do what i intend

                    enjoy
                    maczor
                    • 7. Re: Image link reference?
                      Level 1
                      Hi maczor,

                      re: "does anybody know how can i find full reference of link object properties for itemLink?"

                      Try the object model viewer in the ExtendScript Toolkit?

                      Thanks,

                      Ole