This content has been marked as final. Show 7 replies
>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.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");
P.S. I assume that the link is a Tif file.
Great, thx a lot
but how did you know that?
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?
>but how did you know that?
I found it experimentally.
See Scripting resources section.
>is there a way to do same thing for EPS, PDF and PSD?
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.
> 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:
thank you both, it was quick and gave me enough info to do what i intend
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?