Asked • 07/16/19

Indesign scripting: How to add color to the dialog staticTexts?

Currently developing a script for indesign CS6, using javascript. I am looking for a way to add color to the labels in a dialog ui, The sample code is as follows var myDialog = app.dialogs.add({name:"User Interface Example Script", canCancel:true}); with(myDialog){ //Add a dialog column. with(dialogColumns.add()){ //Create a border panel. with(borderPanels.add()){ with(dialogColumns.add()){ //The following line shows how to set a property as you create an object. staticTexts.add({staticLabel:"Message:"}); I wonder how you can make that label Message a custom color. ** Edit I've found a partial solution using other classes from the javascript API however I would still like to know if the above is possible var w = new Window("dialog"); var s = w.add ("statictext", undefined, "Static"); var e = w.add ("edittext", undefined, "Edit"); var b = w.add ("button", undefined, "Button"); // The window's backround = (, [0.5, 0.0, 0.0]); // Font and its colour for the first item, statictext = ScriptUI.newFont ("Helvetica", "Bold", 30); = (, [0.7, 0.7, 0.7], 1); // Font and colours for the second item, edittext = ScriptUI.newFont ("Letter Gothic Std", "Bold", 30); = (, [1, 0, 0], 1); = (, [0.5, 0.5, 0.5]); // Font for the tird control, a button. Can't set colours in buttons = ScriptUI.newFont ("Minion Pro", "Italic", 30); ();

1 Expert Answer


Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.


Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.