Conditional scripting for Object States?
- This topic has 0 replies, 1 voice, and was last updated 6 years ago by .
- You must be logged in to reply to this topic.
Learn / Forums / InDesign Add-ons (Scripts, Scripting, and Plug-ins) / Conditional scripting for Object States?
Learn / Forums / InDesign Add-ons (Scripts, Scripting, and Plug-ins) / Conditional scripting for Object States?
Tagged: digital publishing, javascript, object states
Hello, Experts!
I have been working on an .indd project that is somewhat a mock calculator that will be deployed via digital publishing. I’ve mocked up a selector box, with 5 states, so when you toggle up or down, you toggle through the states. Correspondingly, there are objects throughout the document that also have 5 states and they, too, change simultaneously as click the toggle buttons. So far so good.
My question: Is it possible to create a script that would check which state my button my selector is on, and also check the state of a second selector and cause a third object to have multiple possible states, based on the combination of both selectors? Basically, an if-and statement?
Example,
If selector 1 shows “Apple” and selector 2 shows “Macintosh”, the third object would show “Red”. But, if Selector 2 showed “Golden Delicious”, third object would show “Yellow”. And if Selector 1 shows “Citrus”, and Selector 2 shows “Lime”, object 3 would show “Green”; “Yellow” if Selector to is in the “Lemon” state.
I hope this clear. I’m trying to get around my current restriction, where each of some 20 objects all must have exactly 5 states and that change as my one selector changes its 5 states. And, I want this to function after deployment.
Any help — even a “can’t be done” would be greatly appreciated.
Here’s an example of what I’m doing. https://indd.adobe.com/view/45d9f43c-1b33-46ee-a8e1-338570fb7041
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies allows us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
To provide the best experiences, we and our partners use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us and our partners to process personal data such as browsing behavior or unique IDs on this site and show (non-) personalized ads. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Click below to consent to the above or make granular choices. Your choices will be applied to this site only. You can change your settings at any time, including withdrawing your consent, by using the toggles on the Cookie Policy, or by clicking on the manage consent button at the bottom of the screen.
You have to be logged in to save.
Not a member? Join Today - it's FREE!