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

change CheckBox Appearance

Community Beginner ,
Jun 16, 2017 Jun 16, 2017

Copy link to clipboard

Copied

Hi,

     I'm using indesign cs6. I want change the checkBox states of Normal On to Normal Off state using indesign scripting. I'm trying more but i can't find it. Pls guide me.

var mySelect=app.selection[0]

var str=mySelect.states;

for(var i=0;i<str.length;i++)

{

    if(str.name=="Normal On")

    {

    str.statetype==StateTypes.DOWN_ON,1181970022

    }

}

Thus, the above code was I'm tried,

The following Image is Require Output

The following Image is given InputOutput.png

Input.png

Thanks,
Sangeetha.K

TOPICS
Scripting

Views

1.6K

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 18, 2017 Jun 18, 2017

Hi Sangeetha,
from your discription I'm not sure what you mean.

Ask yourself: How would I achieve my goal when using InDesign's user interface.
Can you describe that before we get to the scripting part?

Do you want to change the active state?

Like that:

A checkbox done in the UI like the one you are showing:

Checkbox-Done-in-the-UI.png

Duplicated that checkbox and set the first state of the selection with: active = true

Checkbox-ActiveState-States[0]-to-true.png

That will only change what you see in the layout.
If you export both checkboxes to PDF Interactive the behaviors

...

Votes

Translate

Translate
Community Expert ,
Jun 16, 2017 Jun 16, 2017

Copy link to clipboard

Copied

Moving to InDesign Scripting forum

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 Beginner ,
Jun 18, 2017 Jun 18, 2017

Copy link to clipboard

Copied

I find out the answer

app.selection[0].activeStateIndex=0

If I change the activeStateIndex vaule means it will move to next level of the "Normal off".

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 ,
Jun 18, 2017 Jun 18, 2017

Copy link to clipboard

Copied

Hi Sangeetha,

I'm not sure, if you read my two posts before…

// checkBox selected:

app.selection[0].activeStateIndex=0

is the same as:

// checkBox selected:

app.selection[0].states[0].active = true;

Glad it is working for you now.

Would you mark your own answer as "Correct" please.

Thanks,
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
Community Beginner ,
Jun 19, 2017 Jun 19, 2017

Copy link to clipboard

Copied

hi Laubender,

Sorry, i am not saw your post. I Find only

Steve Werner post.

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
Guide ,
Jun 19, 2017 Jun 19, 2017

Copy link to clipboard

Copied

Really sad to see you gave the correct answer mark to Steve

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 Beginner ,
Jun 19, 2017 Jun 19, 2017

Copy link to clipboard

Copied

Hi Laubender,

Actually I am new to this forum. I don't know how to i mark it as its correct. Please can you teach me.

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 ,
Jun 19, 2017 Jun 19, 2017

Copy link to clipboard

Copied

Unmark Steve's post—sorry, Steve ;-)—and mark the other post as correct.
Hope, this helps.

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
Community Expert ,
Jun 18, 2017 Jun 18, 2017

Copy link to clipboard

Copied

Hi Sangeetha,
from your discription I'm not sure what you mean.

Ask yourself: How would I achieve my goal when using InDesign's user interface.
Can you describe that before we get to the scripting part?

Do you want to change the active state?

Like that:

A checkbox done in the UI like the one you are showing:

Checkbox-Done-in-the-UI.png

Duplicated that checkbox and set the first state of the selection with: active = true

Checkbox-ActiveState-States[0]-to-true.png

That will only change what you see in the layout.
If you export both checkboxes to PDF Interactive the behaviors of both checkboxes will be the same.

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
Community Expert ,
Jun 18, 2017 Jun 18, 2017

Copy link to clipboard

Copied

Why did I states[0] and not states[1] ?
The UI is not reflecting the stacking order of states with scripting.

Stacking order of states of a Check Box with scripting from my German InDesign CS6:

As you can see from the locale independent names of the states and the statetype, on and off are switched.

/*

    0    Normal - Aus    $ID/$$$/StateType/NormalOff    StateTypes.UP_OFF

    1    Normal - Ein    $ID/$$$/StateType/NormalOn    StateTypes.UP_ON

    2    Cursor darüber - Aus    $ID/$$$/StateType/OverOff    StateTypes.ROLLOVER_OFF

    3    Cursor darüber - Ein    $ID/$$$/StateType/OverOn    StateTypes.ROLLOVER_ON

    4    Klicken - Aus    $ID/$$$/StateType/DownOff    StateTypes.DOWN_OFF

    5    Klicken - Ein    $ID/$$$/StateType/DownOn    StateTypes.DOWN_ON

*/

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
New Here ,
Jan 22, 2024 Jan 22, 2024

Copy link to clipboard

Copied

LATEST

Hi! I do not have very much experience using scripts. I want to change all the checkboxes in my interactice document from "normal on" to "normal off" at once - otherwise going through and selecting each checkbox individually and changing their default to "normal off" would take waaaaay too much time (it's for a very long workbook).

Is there a way someone could share the code used to run such a script for the latest version of indesign?

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