Quantcast
Channel: Adobe Community: Message List - InDesign Scripting
Viewing all articles
Browse latest Browse all 37788

Re: Copy paste anchored objects in a table

$
0
0

Oh.

There is another thing that is missing (e.g. for a round trip from a character to the anchored object [e.g. the rectangle] and back):

 

The Character object "contains" the rectangle with all properties and all settings (e.g. anchoredObjectSettings).

 

myCharacterThatRepresentsTheAnchoredObject.rectangles[0].fillColor = "Yellow";

 

will fill the anchored object with color "Yellow" (in case it is a rectangle).

 

 

To get it in every case, be it a rectangle, an oval, a polygon etc., you could use the higher level class "SplineItem" or even "PageItem". A caution here. It's best, that you first will "resolve" the specific object out of that class, before applying a property.

 

 

My example with the higher level "PageItem" class will work with just:

 

myCharacterThatRepresentsTheAnchoredObject.pageItems[0].fillColor = "Yellow";

 

but may fail with other, none "SplineItems" (did not test that out entirely) like "Buttons", "MultiStateObjects" etc.

Resolving the specifier should work in any case (or at least will result in a meaningful error message ;-) ):

 

myCharacterThatRepresentsTheAnchoredObject.pageItems[0].getElements()[0].fillColor = "Yellow";

 

Uwe


Viewing all articles
Browse latest Browse all 37788

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>