palette don't work on Illustrator
Hello, hello,
I am learing Script UI and Scripting and I have a problem with palette in scripting Illustrator.
I want use palette to make window Script UI and use it to work with layers in illustrator but don't work.
I paste my code :
--------------------------------------------------
var windowString = 'palette\
{text: "My window",\
myEditText: EditText {characters: 20},\
myButton: Button {text: "Modify ?"}\
}';
var myWindow = new Window(windowString);
function modify()
{
var myValue;
valeur = myWindow.myEditText.text;
myLayer.name = myValue
};
myWindow.myButton.addEventListener("click", modify);
var myDoc = app.activeDocument;
var myLayer = myDoc.activeLayer;
myWindow.show()
--------------------------------------------------
With type : palette, I can't work with Illustrator object (just app, for exemple app.beep() work) but no with document object or path item.
It's work with type : dialog (I can wotk with path item an othes Illustrator objects) )but I need use palette.
Can I get your help please ?
Sorry for my bad english, i can explain again if you want.
