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?
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…
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
works just fine.
I would have thought it contains a single InsertionPoint…
True. I just realized I could do .place() on an InsertionPoint.
- Text disappear after pasting
- display an image for FLV video
- Image Swap + Click Image Swap & Restore Help
- Populating form Fields with an overlaid image
- “Freeze Frame” image is squashed in Photoshop
Related posts brought to you by Yet Another Related Posts Plugin.