1 person found this helpful
@SeniorSSS – these properties are not part of the Links objects, but are (partially, e.g. there is no "dimesions" property) properties of the images that are placed.
You can get access to the placed graphic from the Links object to its parent property:
var myLink = app.documents.links; var myPlacedThing = myLink.parent;
In case your link (in my example the first link in the links list) is a JPEG or a TIFF file, the parent is of type "Image".
To get it always right one could go further and resolve the specifier for that parent.
myPlacedThing could be well a "Graphic", a "Movie", a "Sound" or a "Story".
Resolving the specifier and "make it open" to read-out or apply its properties, one could do the following:
var myPlacedThing = myLink.parent.getElements();
In case of an Image (a subtype of "Graphic", you could then check its properties like actualPpi etc.
As I said: there is no "dimesions" property. For that case one has to calculate the dimensions of that image.
Here some links to the DOM (Document Object Model) documentation Jongware provides:
Here the online documentation in HTML (you will find it more comfortable to use the CHM files Jongware provides):
And another thing: to go from the Link object to the container object that holds the placed asset (=Graphic, Movie, Sound – NOT Story!!), you could ask for the parent.parent of the link and resolve its specifier:
var myContainerOfPlacedThing = app.documents.links.parent.parent.getElements();
Be aware, that in case of a Story object the parent.parent of the Link is the Document object itself!
Quite complicated. But this is the way it is ;-)
Ah. One thing. To calculate the "dimensions" of an placed image see the following thread in the Swiss/German InDesign Scriptung forum at hilfdirselbst.ch:
Solution provided by Hans Haesler, refined a bit by me:
(Read out dimensions of image)
Thanks a lot!
Very helpfull information and links. Lot of stuff to understand but doable now. Thanks again!