Highlighted

Replace all combinations of conditions with "Unconditional"

Explorer ,
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

Adobe Community Professional
Correct answer by brianp311 | Adobe Community Professional

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 = [];

 

 

 

 

TOPICS
Scripting

Views

276

Likes

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

Replace all combinations of conditions with "Unconditional"

Explorer ,
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

Adobe Community Professional
Correct answer by brianp311 | Adobe Community Professional

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 = [];

 

 

 

 

TOPICS
Scripting

Views

277

Likes

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
Jun 06, 2020 0
Adobe Community Professional ,
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 = [];

 

 

 

 

Likes

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
Reply
Loading...
Jun 06, 2020 0
Explorer ,
Jun 06, 2020

Copy link to clipboard

Copied

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

 

 

 

 

Likes

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
Reply
Loading...
Jun 06, 2020 0