🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: adobe.scripting.indesign
7 messages
7 total messages Started by huksy Thu, 05 Feb 2009 11:12
InsertionPoint of Graphics?
#1513
Author: huksy
Date: Thu, 05 Feb 2009 11:12
10 lines
980 bytes
I want to add a "HyperlinkTextDestination" to every graphic. So I have to get their insertionPoints. But I didn't get them!? :-/

This is a part of my first attempt (which doesn't work):

var myIPindex = myGraphics[myCounter].index;
 var myIPstory = myGraphics[myCounter].parent.parent;
 var myIP = myIPstory.insertionPoints[myIPindex];

Got anyone got a hint?
H.
Re: InsertionPoint of Graphics?
#1516
Author: Dave_Saunders
Date: Thu, 05 Feb 2009 12:30
7 lines
731 bytes
myChar = myGraphics[myCounter].parent;

Are you sure you need the insertionPoint for this? If so, add this:

myIP= myChar.insertionPoints[0];

Dave
Re: InsertionPoint of Graphics?
#1520
Author: huksy
Date: Thu, 05 Feb 2009 13:20
9 lines
865 bytes
For adding a HyperlinkTextDestination you need a text or insertion point location. (Or is there another way to link the graphics directly?)

Your way throw's the error of an "unknown method" ...

var myChar = myGraphics[myCounter].parent.;
 var myIP = myChar.insertionPoints[0];

???
H.
Re: InsertionPoint of Graphics?
#1522
Author: Dave_Saunders
Date: Thu, 05 Feb 2009 14:02
5 lines
747 bytes
You've not shown enough of your script. What is myGraphics referring to? How did you construct it?

Did you see the edit to my previous message?

Dave
Re: InsertionPoint of Graphics?
#1523
Author: huksy
Date: Thu, 05 Feb 2009 14:20
6 lines
740 bytes
Sorry, ...
I loop through all graphics of the document. (And they are all within a textframe including the caption)

myGraphics = app.activeDocument.allGraphics;

H.
Re: InsertionPoint of Graphics?
#1524
Author: Dave_Saunders
Date: Thu, 05 Feb 2009 14:51
3 lines
722 bytes
In that case, you need (as I said in the edit) the parent of the parent of the graphic to get to the character that holds the inline/anchored graphic. But that assumes that indeed all the graphics are inline/anchored.

Dave
Re: InsertionPoint of Graphics?
#1529
Author: huksy
Date: Thu, 05 Feb 2009 16:08
7 lines
739 bytes
OMG! I'm soooooo blind!!!
... I didn't regognize, that there is a normal graphic without a caption in my document!

Now it work's perfect!!!

Many Thanks, Dave!
M.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads