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

script code, which will enable value changing by mouse click and scroll

Engaged ,
Sep 02, 2022 Sep 02, 2022

Hello, need help on 

Looking for Illustrator script code, which will enable value changing by mouse click and scroll in the dialog comes while running the custom script. As we do at x and y position in property

 

jkhakase_1-1662102117156.pngexpand image

 

TOPICS
Scripting
579
Translate
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 , Sep 02, 2022 Sep 02, 2022

I assume you are wanting to be able to adjust the values within an edittext field by scrolling your mouse up and down as you can within native Illustrator palettes (while the text is selected). Unfortunately, I don't think it's possible in ExtendScript. JavaScript does have a "wheel" event (see here) but I can't find any mention of it in the ExtendScript docs.

 

An alternate option is to use the arrow keys to increase/decrease the value. Not exactly what you are looking for but similar. The code b

...
Translate
Adobe
Community Beginner ,
Sep 02, 2022 Sep 02, 2022

Sorry but your request doesn't seem clear to me. Would you please provide more explanations?

Translate
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 ,
Sep 02, 2022 Sep 02, 2022

I assume you are wanting to be able to adjust the values within an edittext field by scrolling your mouse up and down as you can within native Illustrator palettes (while the text is selected). Unfortunately, I don't think it's possible in ExtendScript. JavaScript does have a "wheel" event (see here) but I can't find any mention of it in the ExtendScript docs.

 

An alternate option is to use the arrow keys to increase/decrease the value. Not exactly what you are looking for but similar. The code below was taken directly from Peter Kahrel's ScriptUI for dummies book page 88.

 

var w = new Window ("dialog");
var e1 = w.add ("edittext", undefined, "1");
var e2 = w.add ("edittext", undefined, "1"); e1.characters = e2.characters = 3; e1.active = true;
function handle_key (key, control) {
var step;
key.shiftKey ? step = 10 : step = 1; switch (key.keyName)
{
case "Up": control.text = String(Number(control.text)+step); break; case "Down": control.text = String(Number(control.text)-step);
}
} // handle_key
e1.addEventListener ("keydown", function (k) {handle_key (k, this);});
e2.addEventListener ("keydown", function (k) {handle_key (k, this);}); w.show();

 

Translate
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
Engaged ,
Sep 03, 2022 Sep 03, 2022
LATEST

Perfect Answer, if this is not possible through Illustrator script. An alternate option works in my case. So thank you so much @jduncan to suggest the idea to change the value

Translate
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