Why if I get a story and try to
myStory.move(LocationOptions.AT_END , myIP);
Where myStory is all contents of a text frame and myIP is an insertion point in another story.
But when I try this, some paragraphs loose their formatting.
If I select the story, cut it, select the insertion point, and then paste, like this:
It works. Am I missing something?
What if I don't have the document visible?
I'm surprised anything at all happens: AT_ENT should be AT_END
But, seriously, maybe try .AFTER when you place relative to an insertion point.
Misstyped, Mr. Kahrel.
.AFTER do not work at all.
Just changes the unformatted paragraph from the first to the last one.
can you make a sample document available for download where you see this behavior?
Just one page with two text frames not threaded.
( ACP )
Looked into your document.
What is the story you like to move?
Where is the insertion point?
With this example I can see your issue:
var mainStory = app.documents.textFrames.parentStory; var storyToMove = mainStory.textFrames.parentStory; var targetInsertionPoint = mainStory.textFrames.parent.insertionPoints; storyToMove.move( LocationOptions.AT_END , targetInsertionPoint );
Before running the script:
After running the script the paragraph once starting with "e)" changed its formatting:
The reason is clear. You need a paragraph return at the end of the story you like to move.
Otherwise InDesign picks up the formatting from the recieving text.
Now when a paragraph return is added:
The script works as expected:
( ACP )
Perfect, Uwe! Thank you so much.
I can't understand the behavior, but OK. If it works this way, it works this way.
Thank you for the clear explanation, as always!