//opens the modal dialog for editing selected adjustment layers of some types, not all though; based on john nack’s panel; // use it at your own risk; #target photoshop; if (app.documents.length > 0) { var myDocument = app.activeDocument; var checksOut = true; switch (myDocument.activeLayer.kind) { case LayerKind.CURVES: theVars365 = 1131574899; break; case LayerKind.HUESATURATION: theVars365 = 1213428850; break; case LayerKind.SELECTIVECOLOR: theVars365 = 1399612227; break; case LayerKind.LEVELS: theVars365 = 1282829427; break; case LayerKind.BLACKANDWHITE: theVars365 = 1113681495; break; case LayerKind.POSTERIZE: theVars365 = 1349743730; break; case LayerKind.GRADIENTMAP: theVars365 = 1197755760; break; case LayerKind.CHANNELMIXER: theVars365 = 1130917453; break; case LayerKind.THRESHOLD: theVars365 = 1416131187; break; case LayerKind.COLORBALANCE: theVars365 = 1131180610; break; case LayerKind.VIBRANCE: theVars365 = stringIDToTypeID( "vibrance" ); break; case LayerKind.EXPOSURE: theVars365 = 1165521011; break; default: checksOut = false; }; // adjustment layers; if (checksOut == true){ var id365 = theVars365; theModalDialogue (theVars365); } else { // else check for solid fill layer; if (myDocument.activeLayer.kind == "LayerKind.SOLIDFILL" || myDocument.activeLayer.kind == "LayerKind.PATTERNFILL" || myDocument.activeLayer.kind == "LayerKind.GRADIENTFILL") { try { layerContentOptions() } catch (e) {} } else { alert("selected layer is neither curves–, hue/saturation-, selective color-, levels-, black and white-, posterize-, gradient map- or threshold-adjustment layer nor a solidfill-, gradient- or pattern-layer") } } }; ////// modal editing ////// function theModalDialogue (theVars365) { ErrStrs = {}; ErrStrs.USER_CANCELLED=localize("$$$/ScriptingSupport/Error/UserCancelled=User cancelled the operation"); try { var id359 = charIDToTypeID( "setd" ); var desc77 = new ActionDescriptor(); var id360 = charIDToTypeID( "null" ); var ref48 = new ActionReference(); var id361 = stringIDToTypeID( "contentLayer" ); var id362 = charIDToTypeID( "Ordn" ); var id363 = charIDToTypeID( "Trgt" ); ref48.putEnumerated( id361, id362, id363 ); desc77.putReference( id360, ref48 ); var id364 = charIDToTypeID( "T " ); desc77.putClass( id364, id365 ); executeAction( id359, desc77, DialogModes.ALL ); } catch(e){ if (e.toString().indexOf(ErrStrs.USER_CANCELLED)!=-1) {; } else{ alert("$$$/ScriptingSupport/Error/CommandNotAvailable=The command is currently not available"); } } }; ////// edit solid fill ////// function layerContentOptions () { var id450 = charIDToTypeID( "slct" ); var desc90 = new ActionDescriptor(); var id451 = charIDToTypeID( "null" ); var ref61 = new ActionReference(); var id452 = charIDToTypeID( "Mn " ); var id453 = charIDToTypeID( "MnIt" ); var id454 = charIDToTypeID( "AdjO" ); ref61.putEnumerated( id452, id453, id454 ); desc90.putReference( id451, ref61 ); executeAction( id450, desc90, DialogModes.ALL ) }; |