![]() |
|
|
|
|
|
|
4
21st November 08:51
External User
Posts: 1
|
add "\r" at end of your text contents or as a single character
app.selection[0].paragraphs[0].insertionPoints[-1].contents = 'Voiceover\r' or app.selection[0].paragraphs[0].insertionPoints[-1].contents = '\r' if you are building new text in new empty Story or at end of current Story - don't use absolute index - .insertionPoints[10] - use .insertionPoints[-1] as reference to last item app.selection[0].paragraphs[-1].insertionPoints[-1].contents = '\r' (you need to add this line if you want to start new paragraph after existing text) app.selection[0].paragraphs[-1].appliedParagraphStyle = 'BigRed' app.selection[0].paragraphs[-1].insertionPoints[-1].contents = 'Voiceover\r' app.selection[0].paragraphs[-1].appliedParagraphStyle = 'BigRed2' app.selection[0].paragraphs[-1].insertionPoints[-1].contents = 'Line 2\r' like you can see - you need to switch order of lines - first you need to set formatting (ParaStyle) - then set new contents - and this is the best order of operations step 1 - set formatting to LastInsertionPoint step 2 - set contents of LastInsertionPoint thanks to this - you don't need to care how long will be your new text ![]() if you want to add new text to empty TextFrame - you can't refer to first paragraph - because there is no paragraphs in empty TextFrame - you need to refer to insertionPoint - and better - to last insertionPoint of parentStory app.selection[0].parentStory.insertionPoints[-1] robin -- www.adobescripts.com |
|
| Some other forums that might be of your interest : Adobe, Adobe after effects, Acrobat, Elements, Golive, Illustrator, Indesign, Premier, Adobe mac, General mac, Acrobat, Golive, Illustrator, Indesign |