#target photoshop app.bringToFront(); main(); function main(){ if(!documents.length){ alert("You need to have at least one document open!"); return; } var win = new Window( 'dialog', 'RA' ); g = win.graphics; var myBrush = g.newBrush(g.BrushType.SOLID_COLOR, [0.99, 0.99, 0.99, 1]); g.backgroundColor = myBrush; win.orientation='stack'; win.p1= win.add("panel", undefined, undefined, {borderStyle:"black"}); win.g1 = win.p1.add('group'); win.g1.orientation = "row"; win.title = win.g1.add('statictext',undefined,'Run Action(s)'); win.title.alignment="fill"; var g = win.title.graphics; g.font = ScriptUI.newFont("Georgia","BOLDITALIC",22); win.p1.p1= win.p1.add("panel", undefined, undefined, {borderStyle:"black"}); win.p1.p1.preferredSize=[300,2]; win.g3 =win.p1.add('group'); win.g3.orientation = "row"; win.g3.alignment='fill'; win.g3.spacing=10; win.g3.cb1 = win.g3.add('checkbox',undefined,'Create Snapshop'); win.g5 =win.p1.add('group'); win.g5.orientation = "row"; win.g5.alignment='fill'; win.g5.spacing=10; win.g5.cb1 = win.g5.add('checkbox',undefined,'Run Action(s) On All Layers'); win.g5.cb1.value=true; win.g6 =win.p1.add('group'); win.g6.orientation = "row"; win.g6.alignment='fill'; win.g6.spacing=10; win.g6.cb1 = win.g6.add('checkbox',undefined,'Run Action(s) On Selected Layer(s)'); if(activeDocument.layers.length < 2){ win.g6.cb1.enabled=false; } var selectedLayers= getSelectedLayersIdx(); if(selectedLayers.length <1) win.g6.cb1.enabled=false; win.g5.cb1.onClick=function(){ if(win.g5.cb1.value){ win.g6.cb1.value=false; }else{ win.g6.cb1.value=true; if(selectedLayers.length >1) win.g6.cb1.enabled=true; } } win.g6.cb1.onClick=function(){ if(win.g6.cb1.value){ win.g5.cb1.value=false; }else{ win.g5.cb1.value=true; } } win.g5.cb1.onClick(); win.p1.p2= win.p1.add("panel", undefined, undefined, {borderStyle:"black"}); win.p1.p2.preferredSize=[300,2]; win.g10 =win.p1.add('group'); win.g10.orientation = "row"; win.g10.alignment='fill'; win.g10.spacing=10; win.g10.dd1 = win.g10.add('dropdownlist'); win.g10.dd2 = win.g10.add('dropdownlist'); win.g15 =win.p1.add('group'); win.g15.orientation = "row"; win.g15.alignment='fill'; win.g15.spacing=10; win.g15.st1 = win.g15.add('statictext',undefined,'Selected Actions'); win.g15.et1 = win.g15.add('edittext',undefined,'0'); win.g15.et1.preferredSize=[40,20]; win.g15.et1.enabled=false; win.g15.bu1 = win.g15.add('button',undefined,'Add Action'); win.g15.bu2 = win.g15.add('button',undefined,'Remove Action'); win.p1.p3= win.p1.add("panel", undefined, undefined, {borderStyle:"black"}); win.p1.p3.preferredSize=[300,2]; win.g20 =win.p1.add('group'); win.g20.orientation = "row"; win.g20.alignment='center'; win.g20.spacing=10; win.g20.bu1 = win.g20.add('button',undefined,'Process'); win.g20.bu1.preferredSize=[170,35]; win.g20.bu2 = win.g20.add('button',undefined,'Cancel'); win.g20.bu2.preferredSize=[170,35]; var actionSets = new Array(); actionSets = getActionSets(); for (var i=0,len=actionSets.length;i