This content has been marked as final. Show 6 replies
>myindesign.ActiveDocument.pages.item(1).links [..] give me an error<br /><br />That's because pages do not have a links property. Whatever manual you saw that in, throw it out, and use the proper Help manual. Pages have an allGraphics property, which conveniently "Lists all graphics contained by the Page." (from the ESTK2 Help). Rather <br />i unconventiently <br />is that this graphic type first contains a link, and the link then contains a filename -- you have to string'em all together by hand.<br /><br />Try this instead. It iterates over all your pages (first loop) and over all images on that page (2nd loop). This one is sure to display the items in order of appearance (which is possibly different when iterating over all links in your document at once).<br /><br />>for (var p=0; p<app.activeDocument.pages.length; p++)<br /><br />> for (var g=0; g<app.activeDocument.pages[p].allGraphics.length; g++)<br /><br />> app.activeDocument.selection.contents = app.activeDocument.selection.contents+"\r"+app.activeDocument.pages[p].allGraphics[g]. itemLink.name+" Page "+app.activeDocument.pages[p].name;<br /><br />[Before running this, draw an empty text frame and place your text cursor in that.]
Thanks for your answer!! At least this give a good idea. I use Vbscript but I think I can understand.
Do you have a complete guide?? because the scripting guides available show only how to put an image but nothing else... and I couldn't find the CS3 Reference... :(
If I can't complete it I will let you know... thank you!!!
I wouldn't know where to start searching for VBscript ...
For JS, it's rather sneaky hidden inside the ESTK2 editor, in the Help menu. That didn't quite work for me, so when I found the XML data file, I wrote an XSLT stylesheet to convert it to linked HTML. (That's 3 technojibe terms in a single sentence!) You can download this version from http://www.jongware.binaries.indesigncs3jshelp.zip
Do note, it's for JS only. VBscript has other case rules.
The parent of the link is the frame containing the graphic. The parent of the frame is *usually* a page, but it can sometimes be a group, a character, or another page item. If you know that all of your images are placed as independent graphics (i.e., not in groups, not embedded in text, and not pasted inside another frame), then you can use something like this:
Rem Given a link "myLink"...
myPageName = myLink.Parent.Parent.Name
Rem Display information about the link in a message box.
MsgBox myLink.name & " appears on page " & myPageName
If your graphics are not independent graphics, you'll need to do a little bit more work--what we call "climbing the parent tree"--to find the page containing the graphic. Let us know, and we'll show you our various solutions to that problem.
I'm interested this topic too. I have a 1000+inline images placed and i need to "export" links list with page reference. Only solution seems to be scripting.
I have done some scripting with applescript but some pointers would be appreciated.
maybe the JS LinkExport_and_PreflightImages_1.2.jsx is of some kind of interest for you.
It catches some more info about the links. But you can cut away the info you don't need.