Moving to InDesign Scripting forum
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?
A checkbox done in the UI like the one you are showing:
Duplicated that checkbox and set the first state of the selection with: active = true
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.
1 person found this helpful
Why did I states and not states ?
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 */
I find out the answer
If I change the activeStateIndex vaule means it will move to next level of the "Normal off".
I'm not sure, if you read my two posts before…
// checkBox selected: app.selection.activeStateIndex=0
is the same as:
// checkBox selected: app.selection.states.active = true;
Glad it is working for you now.
Would you mark your own answer as "Correct" please.
Really sad to see you gave the correct answer mark to Steve
Actually I am new to this forum. I don't know how to i mark it as its correct. Please can you teach me.
Unmark Steve's post—sorry, Steve ;-)—and mark the other post as correct.
Hope, this helps.