Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Move xml element from Structure pane in ID CS4

New Here ,
May 04, 2010 May 04, 2010

Hi,

I need the following action in ID CS4, to move xml element from its structure pane to a new text frame.

My action is:

1. Select the xml element in Structure.

2. Run the script to identify the selected element in Structure.

3. Move the xml element to separate New text frame.

I wrote the script for this three step. But I am unable to move the selected xml structure to new text frame.

My code is:

var myXMLElementA = app.selection[0];
var myTextFrameA = app.activeDocument .pages[2].textFrames.add({geometricBounds:[0, 0, 160, 160], contents:" "});
myXMLElementA.move(LocationOptions.atBeginning, myTextFrameA.insertionPoints.item(0));

Can anyone help me on this.

Thanks,

Gopal

TOPICS
Scripting
427
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
May 05, 2010 May 05, 2010

Use placeXML instead of move().

var myXMLElementA = app.selection[0];
var myTextFrameA = app.activeDocument.pages[2].textFrames.add({geometricBounds:[0, 0, 160, 160], contents:" "});
myXMLElementA.placeXML(myTextFrameA);

Shonky

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 06, 2010 May 06, 2010
LATEST

Thanks Shonkyin

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines