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

Conditional scripting for Object States?

Contributor ,
Apr 07, 2018 Apr 07, 2018

Copy link to clipboard

Copied

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 2 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.

Here’s an example of what I’m doing. https://indd.adobe.com/view/45d9f43c-1b33-46ee-a8e1-338570fb7041

Any help — even a “can’t be done” would be greatly appreciated.

TOPICS
Scripting

Views

877

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 , Apr 08, 2018 Apr 08, 2018

HI rsbisa ,

I think, such a project should be done with JavaScript for Web and then included in the Publish Online project.

It's nothing you could do with InDesign scripting, because for that you need InDesign at runtime.

Or you have to do it  as you fear:

Prepare all states for all possible results with an MSO.

That could be a project for InDesign scripting.

Regards,
Uwe

Votes

Translate

Translate
Guide ,
Apr 08, 2018 Apr 08, 2018

Copy link to clipboard

Copied

Cool! …

Could you share the native file (.idml) + fonts?

Best,

Michel, from FRIdNGE

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
Contributor ,
Apr 08, 2018 Apr 08, 2018

Copy link to clipboard

Copied

The font is Century Gothic, and is in your ID font selection. I can share the .idml later. I was inspired by this tutorial on Multi-state Objects (MSO), by Ajar Productions.

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
Community Expert ,
Apr 08, 2018 Apr 08, 2018

Copy link to clipboard

Copied

HI rsbisa ,

I think, such a project should be done with JavaScript for Web and then included in the Publish Online project.

It's nothing you could do with InDesign scripting, because for that you need InDesign at runtime.

Or you have to do it  as you fear:

Prepare all states for all possible results with an MSO.

That could be a project for InDesign scripting.

Regards,
Uwe

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
Contributor ,
Apr 08, 2018 Apr 08, 2018

Copy link to clipboard

Copied

LATEST

Thank you! After sleeping on it, I woke with the same conclusion. Not the answer I wanted - but certainly the answer I needed. I could have spent days struggling with 100s of possible states.

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