Hi All,

 

I’m using InDesign CS5 and ActionScript.

 

I have some text in a TextFrame marked with various Tags (XMLElements). I also want an in-line image between several of the words, with that image having its own Tag.

 

I first entered some text in several tags, and then emptied the text from one of the Tags so that I could place a picture there which would move in-line with the text.

 

The problem is, I can not figure out how to place an image file into an XMLElement. There is no way to add a new image  – the XMLElement’s “images” property doesn’t have an add() method, and there is no XMLElement.place() method.

 

How can I place a picture in an extant XMLElement via scripting?

 

 

TIA,

mlavie

|||

I’m not sure, but the way you probably need to go is to first place the image into the text and then markup the image with the xml you want…

 

Harbs

|||

Hi Harbs,

 

Thanks for responding. I managed to figure this one out myself, although it is not exactly intuitive.

 

The empty tag (XMLElement) seems to have a a single, empty Text in its texts collection. Oddly enough, the Text class has a place method, so

 

texts.item(0).place(myFile)

 

works just fine.

 

 

mlavie

|||

It’s empty?

 

I would have thought it contains a single InsertionPoint…

|||

True. I just realized I could do .place() on an InsertionPoint.

© 2012 free icons download Suffusion theme by Sayontan Sinha

Featuring Recent Posts WordPress Widget development by YD