• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Replace all combinations of conditions with "Unconditional"

Explorer ,
Jun 06, 2020 Jun 06, 2020

Copy link to clipboard

Copied

Can any one tell me how to iterate through all combinations of conditions and replace with "Unconditional"?

 

Let's say for example, we have three conditions: A, B, and C. I would need the following combinations to be reaplaced:

 

A -> Unconditional

B -> Unconditional

C -> Unconditional

A&B -> Unconditional

A&C -> Unconditional

B&C -> Unconditional

A&B&C -> Unconditional

 

This is just an example. A document may contain any number of conditionals (may be up to eight).

 

Thank you in advance.

Tak

TOPICS
Scripting

Views

492

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jun 06, 2020 Jun 06, 2020

Assume you're talking about conditional text? 

 

 

app.activeDocument.textFrames.everyItem().texts.everyItem().appliedConditions = [];

 

If some is inside tables, you'll also need: 

app.activeDocument.stories.everyItem().tables.everyItem().cells.everyItem().texts.everyItem().appliedConditions = [];

 

 

 

 

Votes

Translate

Translate
Community Expert ,
Jun 06, 2020 Jun 06, 2020

Copy link to clipboard

Copied

Assume you're talking about conditional text? 

 

 

app.activeDocument.textFrames.everyItem().texts.everyItem().appliedConditions = [];

 

If some is inside tables, you'll also need: 

app.activeDocument.stories.everyItem().tables.everyItem().cells.everyItem().texts.everyItem().appliedConditions = [];

 

 

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 06, 2020 Jun 06, 2020

Copy link to clipboard

Copied

LATEST

Thanks for the reply. Iterating through every text item, rather than finding and replacing, makes sense.

 

 

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines