Copy link to clipboard
Copied
How are friends, could anyone tell me how I could apply conditional text "TEACHER" only in a particular paragraph style? Thanks for the help, thank you.
Hello there,
Try this below code.
applyCondition();
function applyCondition(){
var myParaStyle = 'TEACHER';
app.findTextPreferences.appliedParagraphStyle = myParaStyle;
var found = app.documents[0].findText();
var c = 0;
while(c < found.length){
found
.paragraphs.everyItem().appliedConditions = app.documents[0].conditions.item('TEACHER'); c++;
}
}
Copy link to clipboard
Copied
Hello there,
Try this below code.
applyCondition();
function applyCondition(){
var myParaStyle = 'TEACHER';
app.findTextPreferences.appliedParagraphStyle = myParaStyle;
var found = app.documents[0].findText();
var c = 0;
while(c < found.length){
found
.paragraphs.everyItem().appliedConditions = app.documents[0].conditions.item('TEACHER'); c++;
}
}
Copy link to clipboard
Copied
Thanks my friend. Perfect.
Copy link to clipboard
Copied
Hi... so I tried this... it's .jsx right? I changed the 'Teacher' to my corresponding paragraph style and it didn't work. Bit lost as to how this works.
Copy link to clipboard
Copied
For readers, if not included in a more complete process, no need a script for such a simple work! A simple F/R will be enough.
(^/) The Jedi