Skip to main content
Participating Frequently
May 14, 2012
Question

Deleteing assoiated text form conditional text dialiog

  • May 14, 2012
  • 2 replies
  • 3872 views

Hi,

          I have made some contition set using "conditional text" dialig. I want, when I delete those condition set, there associated text should also be deleted. How is that possible. If anyone knows please tell me

Thanks in advance

Ranjan

This topic has been closed for replies.

2 replies

Trevor:
Legend
May 15, 2012

Ranjan

Was the code above helpfull, Correct?

If yes then mark it as correct and a little bit of manners would be to say thank you, it doesn't hurt.

I saw of all the post you have posted you have not marked any as correct or said thank you one time after receiving the answer you want.

I don't think that people who demand scripts (not you) or people who show no recognition / appreciation to those who help them (you) can expect to receive help.

Trevor:
Legend
May 14, 2012

I'm sure there's a better way of doing it but this works.

#target indesign

var myDoc = app.activeDocument;

app.findGrepPreferences = app.changeGrepPreferences = null;

// Change "Condition 1" to name of your condition

myCondition = "Condition 1";

app.findGrepPreferences.appliedConditions = [myCondition] ;

app.findGrepPreferences.findWhat = ".+";

myDoc.changeGrep();

app.activeDocument.conditions.item(myCondition).remove();

Vincent-Sweden
Known Participant
April 25, 2013

Hello Trevor,

I am experiencing the same problem as Ranjan. I'm totally new att this scripting feature, and I don't know how to add this... is is javascript?

Thank you.

Vamitul
Legend
April 25, 2013

Hi Vincent.

Copy the above script to a plain text file, name it whatever you want but add the ".jsx" extension to it, then you can just double click on it because it has the #target directive, or you can follow these instructions:

http://indesignsecrets.com/how-to-install-scripts-in-indesign.php