How do I change a text in Illustrator using a window type PALETTE when using DIALOG PALETTE works but with no, someone can explain me why?
my script is...
#target Illustrator
var sourceDoc=app.activeDocument;
var myMaterials = ["FILME POLIÉSTER HOLOGRÁFICO", "FILME BOPP METALIZADO","FILME BOPP BRANCO","PAPEL COUCHÊ", "PVC PLANO"];
var myWin = new Window ("dialog","Materiais");
myWin.orientation = "row";
myNewList=myWin.add ("dropdownlist", undefined, myMaterials);
myNewList.selection = 0;
myOkButton=myWin.add ("button", undefined, "Ok",{name: "ok"});
myCancelButton=myWin.add ("button", undefined, "Cancelar",{name: "cancel"});
myNewList.onChange = function () {
var item=myNewList.selection
var myTextFrame = sourceDoc.textFrames.getByName("MATERIAL");
myTextFrame.contents=item;
}
myWin.show ();