myIP.contents = "some text" + SpecialCharacters.columnBreak + "some more text";
create a helper textframe outside of the page and add the ColumnBreak with a GREP or TEXT changeTo command. Then duplicate the ColumnBreak character to where you want it in the text.
Copy link to clipboard
Hi @John Bruestle,
Very interesting problem.
myIP.contents = "some text" + "\r" + "some more text"; // won't work
Note that this is a special case. Most of the time you can reduce the SpecialCharacters enum into the corresponding "\uHHHH" code. (More on ID special character codes here: https://www.indiscripts.com/post/2009/07/idcs4-special-characters)
// The text you want to insert as an array // (isolating the special char enum.) // --- var a = ["some text", SpecialCharacters.columnBreak, "some more"]; for( var i=a.length ; i-- ; myIP.insertionPoints.contents=a[i] );
A bit heavy-handed, but I'm curious if our colleagues have found a better approach.
Disregard. I was thinking of other special chars that are replaceable. I was going to say I usually insert a unique string and then findText to replace. Either Steve or Marc's approaches probably are the only way. The other solution would be to apply a column break Keep style to the string that occurs prior to the break.
I do not know any other possibility to handle this case.
In terms of readability of would prefer a three liner without for-loop.
a different approach, yes, but not a better one:
One alternative would be to move text in, one character, the one with the special character that has to be added to a new text frame.
( Adobe Community Expert )