Simple UI test
i've managed check boxes working. no vast feat know i'm happy it!
feast eyes on incredible red or grey box script!
/// simple ui script creates image , fills red or grey
preferences.rulerunits = units.pixels
var dlg=
"dialog{text:'script interface',bounds:[100,100,280,250],"+
"panel0:panel{bounds:[10,10,170,140] , text:'fill box ' ,properties:{borderstyle:'etched',su1panelcoordinates:true},"+
"redcheck:checkbox{bounds:[30,30,120,51] , text:'change red' },"+
"exit:button{bounds:[30,90,130,110] , text:'cancel' },"+
"fill:button{bounds:[30,60,130,80] , text:'fill it!' },"+
"},"+
"};"
var colorref = new solidcolor;
colorref.rgb.hexvalue="a6a6a6"
var win = new window(dlg,'simple window');
win.center();
win.panel0.exit.onclick = function(){
win.close(1);
}
win.panel0.redcheck.onclick = function(){
if (win.panel0.redcheck.value){
colorref.rgb.hexvalue="dd0022";
} else {
colorref.rgb.hexvalue="a6a6a6";
}
}
win.panel0.fill.onclick = function(){
var docref = documents.add(100, 100, 72.0);
app.activedocument.selection.fill(colorref)
win.close(1);
}
win.show();
More discussions in Photoshop Scripting
adobe
Comments
Post a Comment