Created
October 24, 2018 05:34
-
-
Save AlexeyNik/a1a9feac6ba2f4ace8efc2a6cd79b4b4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function addTextToPara(pStyleName, prefixText) | |
{ | |
app.findGrepPreferences.appliedParagraphStyle = pStyleName | |
var paraList = app.activeDocument.findGrep() | |
for(var i = 0 ; i < paraList.length; i++) | |
{ | |
paraList[i].contents = prefixText + paraList[i].contents | |
} | |
app.findGrepPreferences = NothingEnum.nothing; | |
} | |
//Change the argument with the name of the paragraph style you want to search and the text you want to add before that para | |
addTextToPara("Paragraph Style 2", "<1>") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment