Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

423
Views
In Adobe Illustrator, How to change white color of Edittext to transparent with javascript when it is active

enter image description here

I want to change white color to transparent when the edittext is active. Please help me.

w.alignChildren = ["fill","fill"];
w.preferredSize = [150, 250];
w.inputBox = w.add('panel', undefined, "Input Box");

w.inputBox.add('statictext{text: "Height: "}');

var heightInput = w.inputBox.add('edittext {characters: 12, active: true}');

w.inputBox.add('statictext{text: "Width: "}');

var widthInput = w.inputBox.add('edittext {characters: 12, active: false}');

w.inputBox.add('statictext{text: "Spine: "}');

var spineInput = w.inputBox.add('edittext {characters: 12, active: false}');

w.inputBox.add('statictext{text: "Joint: "}');

var jointInput = w.inputBox.add('edittext {characters: 12, active: false}');

var okBtn = w.add("button", undefined, "Draw");
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Try this:

// set background color for 'Height' to the dark gray [0.2,0.2,0.2]
heightInput.graphics.backgroundColor 
  = heightInput.graphics.newBrush(heightInput.graphics.BrushType.SOLID_COLOR,[0.2, 0.2, 0.2]);

// text color for 'Height' to white [1,1,1]
heightInput.graphics.foregroundColor
  = heightInput.graphics.newPen(heightInput.graphics.PenType.SOLID_COLOR, [1,1,1], 1);

But UI can work differently in some versions of Illustrator. I just tested it in my CS6/Win10 and it seems work.

More information is here: https://creativepro.com/files/kahrel/indesign/scriptui.html

enter image description here

Full code:

var w = new Window ("dialog");

var text_color = [1,1,1];
var bg_color = [.2,.2,.2];

w.alignChildren = ["fill","fill"];
w.preferredSize = [150, 250];
w.inputBox = w.add('panel', undefined, "Input Box");

w.inputBox.add('statictext{text: "Height: "}');

var heightInput = w.inputBox.add('edittext {characters: 12, active: true}');
heightInput.graphics.foregroundColor = heightInput.graphics.newPen(heightInput.graphics.PenType.SOLID_COLOR, text_color, 1);
heightInput.graphics.backgroundColor = heightInput.graphics.newBrush(heightInput.graphics.BrushType.SOLID_COLOR,bg_color);

w.inputBox.add('statictext{text: "Width: "}');

var widthInput = w.inputBox.add('edittext {characters: 12, active: false}');
widthInput.graphics.foregroundColor = widthInput.graphics.newPen(widthInput.graphics.PenType.SOLID_COLOR, text_color, 1);
widthInput.graphics.backgroundColor = widthInput.graphics.newBrush(widthInput.graphics.BrushType.SOLID_COLOR,bg_color);

w.inputBox.add('statictext{text: "Spine: "}');

var spineInput = w.inputBox.add('edittext {characters: 12, active: false}');
spineInput.graphics.foregroundColor = spineInput.graphics.newPen(spineInput.graphics.PenType.SOLID_COLOR, text_color, 1);
spineInput.graphics.backgroundColor = spineInput.graphics.newBrush(spineInput.graphics.BrushType.SOLID_COLOR,bg_color);

w.inputBox.add('statictext{text: "Joint: "}');

var jointInput = w.inputBox.add('edittext {characters: 12, active: false}');
jointInput.graphics.foregroundColor = jointInput.graphics.newPen(jointInput.graphics.PenType.SOLID_COLOR, text_color, 1);
jointInput.graphics.backgroundColor = jointInput.graphics.newBrush(jointInput.graphics.BrushType.SOLID_COLOR,bg_color);

var okBtn = w.add("button", undefined, "Draw");

w.show();

Win10 / CS6:

enter image description here

MacOS High Sierra / CC 2014 (18.0.0)

enter image description here

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!