app.activeDocument.conditions.item("Condition 1").visible=true;//Unhide the conditional text ("Condition 1" will be your condition name) app.findGrepPreferences = app.changeGrepPreferences = null; app.findGrepPreferences.findWhat = ".+"; app.findGrepPreferences.appliedConditions = [app.activeDocument.conditions.item("Condition 1")];//finding the text with the corresponding condition app.changeGrepPreferences.changeTo = "";//deleting the text app.activeDocument.changeGrep(); app.findGrepPreferences = app.changeGrepPreferences = null; app.activeDocument.conditions.item("Condition 1").visible=false;//Hiding the conditional text again (optional)
Turning ON the condition it's a pain because I'm working with lots of conditions. The script that you gave me works great but it takes 1 minute and 15 seconds to run.
What I'd like to do is to select the condition markers (the eyes) and delete them. In this way I don't need to activate all the condition and loose a lot of time.
If you see the image, the first box is the original and the second one is what I would obtain.
Ivan, Find&Change only works on a condition when it is visible. There are other ways, but generally Find&Change is way faster than having a script "manually" process all text for each condition in turn.
You may be able to speed this script up a bit by (1) disabling redraw, or (2) closing the file and then opening it without a window. (Trying both at the same time is useless )