-
Retrieving information written by user into “EditText” field to modify a layers text source later
Hello, I’m rewriting my script following David Torno’s tutorials again and I think I’m on the right path this time. However, something I had managed to figure out with the other method was to be able to retrieve user input from a “prompt();” and then use that info to modify a text layer’s source text. With this method however, the one that allows your script to be run either from the script menu or the window menu, I haven’t been able to do it. What I exactly need is to be able to retrieve that input and collect it to a new variable so I can use it later.
In addition to that my script doesn’t show anything when run under the window menu. The panel is displayed, it’s dockable and resizable but it shows nothing inside. When it’s run from the script menu all the items are displayed correctly. Any help will be greatly appreciated…
function entelWow(thisObj){
function entelWow_buildUI(thisObj){
var myPanel = (thisObj instanceof Panel) ? thisObj : new Window("palette","textosWow",undefined, {resizeable:true});
res = "group{orientation:'column',\
groupOne:Group{orientation:'column',\
logo: Image{text:'logo', image:'~/Desktop/logoEntel.png'},\
equipoTE: StaticText{text:'Equipo',alignment:'left'},\
equipoInput: EditText{text:'',size:[150,25],alignment:'left'},\
modeloTE: StaticText{text:'Modelo',alignment:'left'},\
modeloInput: EditText{text:'',size:[150,25],alignment:'left'},\
costoequipoTE: StaticText{text:'Costo del equipo',alignment:'left'},\
costEqInput: EditText{text:'',size:[150,25],alignment:'left'},\
costoequipoTE: StaticText{text:'Costo del plan',alignment:'left'},\
costPlInput: EditText{text:'',size:[150,25],alignment:'left'},\
myButton: Button{text:'Aplicar'},\
},\
}";
myPanel.grp = myPanel.add(res);
var equipo = myPanel.grp.groupOne.equipoInput;
var modelo = myPanel.grp.groupOne.modeloInput;
var costoEq = myPanel.grp.groupOne.costEqInput;
var costoPl = myPanel.grp.groupOne.costPlInput;
var aplicar = myPanel.grp.groupOne.myButton;
aplicar.onClick = function(){
alert(equipo);
}
return myPanel;
}
var entelPal = entelWow_buildUI(thisObj);
if((entelPal != null) && (entelPal instanceof Window)){
entelPal.center();
entelPal.show();}
}
entelWow(this);