Skip to main content
Known Participant
May 19, 2011
Answered

statictext control in script UI

  • May 19, 2011
  • 1 reply
  • 2671 views

how to change the statictext text value during run time??

for eg, if my dialog box (which contains a static text n a button) is being displayed, so i want the statictext text value to change whn i click on the button...

This topic has been closed for replies.
Correct answer milligramme

Hi. try this snippet.

var w = new Window('dialog',"test");

var t = w.add('statictext', undefined, "1");

var b = w.add('button', undefined, "+1");

t.characters = 3;

b.onClick = function() {

  t.text = (t.text-0)+1;

}

w.show();

And then

You should refer <a href="http://www.kahrel.plus.com/indesign/scriptui.html">ScriptUI for dummies | Peter Kahrel</a>

This PDF contains many many helps for coding ScriptUI.

thankyou

mg.

1 reply

milligramme
milligrammeCorrect answer
Inspiring
May 20, 2011

Hi. try this snippet.

var w = new Window('dialog',"test");

var t = w.add('statictext', undefined, "1");

var b = w.add('button', undefined, "+1");

t.characters = 3;

b.onClick = function() {

  t.text = (t.text-0)+1;

}

w.show();

And then

You should refer <a href="http://www.kahrel.plus.com/indesign/scriptui.html">ScriptUI for dummies | Peter Kahrel</a>

This PDF contains many many helps for coding ScriptUI.

thankyou

mg.

Known Participant
May 20, 2011

thanks..it worked!!