Copy link to clipboard
Copied
I need to select anchored textframes and should move its content to main story without removing or deleting the anchor. If it was deleted or removed contents are not getting inside main story. But i dont know how to select the anchored textframe itself. Please help me with this one. Also I am trying this way. Is there any other other way to move its content to main story without affecting the anchored frame.
Manually if we select the anchored xml element and drag it outside the menu, the contents of that anchored frame is moving away from anchored frame is it possible to do it via scripting??
> Because i dont know how to select anchored object frame
Well, like you did: click it, and app.selection[0] is your anchored frame.
But if you want to process a story with many anchored frames, select a frame of the story that contains the anchored frames and run this script:
anchoredFrames = app.selection[0].parentStory.textFrames.everyItem().getElements();
for (i = anchoredFrames.length-1; i >= 0; i--) {
anchoredFrames[i].parentStory.move (
LocationOptions.BEFORE,
anchoredFram
...
Copy link to clipboard
Copied
I am trying it using indesign javascript! please provide solution in javascript
Copy link to clipboard
Copied
Select the text with the text tool and cut it into the pasteboard, insert the text to the target place and paste. If you want to paste without formatting it is a different command.
Copy link to clipboard
Copied
An anchor's parent is a character. So all you need to do is to move the anchored frame's content to before or after the anchor's parent.
Given a text frame that contains an anchored frame, select the text frame and run this script:
a = app.selection[0].textFrames[0];
a.parentStory.move (
LocationOptions.BEFORE,
a.parent);
Copy link to clipboard
Copied
It shows object is invalid! But when i do as below only with selection it was working. Actually it seems to be object textFrame, How to select all anchored object textframe one by one and move its contents as you said!
a = app.selection[0];
a.parentStory.move (
LocationOptions.BEFORE,
a.parent);
Because i dont know how to select anchored object frame, Please help me in this case
Copy link to clipboard
Copied
> Because i dont know how to select anchored object frame
Well, like you did: click it, and app.selection[0] is your anchored frame.
But if you want to process a story with many anchored frames, select a frame of the story that contains the anchored frames and run this script:
anchoredFrames = app.selection[0].parentStory.textFrames.everyItem().getElements();
for (i = anchoredFrames.length-1; i >= 0; i--) {
anchoredFrames[i].parentStory.move (
LocationOptions.BEFORE,
anchoredFrames[i].parent
);
}
Copy link to clipboard
Copied
Thank you very much @Peter Kahrel ! working fine