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.

Related posts:

  1. Text disappear after pasting
  2. display an image for FLV video
  3. Image Swap + Click Image Swap & Restore Help
  4. Populating form Fields with an overlaid image
  5. “Freeze Frame” image is squashed in Photoshop

Related posts brought to you by Yet Another Related Posts Plugin.

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

   
© 2012 free icons download Suffusion theme by Sayontan Sinha

Featuring Recent Posts WordPress Widget development by YD