Add Colour Overlay layer style with colour from Clipboard?
I managed to grab a script using the ScriptingListener plugin that will add the 'Colour Overlay' layer style to the selected layer or folder.
// =======================================================
var idsetd = charIDToTypeID( "setd" );
var desc9 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref1 = new ActionReference();
var idPrpr = charIDToTypeID( "Prpr" );
var idLefx = charIDToTypeID( "Lefx" );
ref1.putProperty( idPrpr, idLefx );
var idLyr = charIDToTypeID( "Lyr " );
var idOrdn = charIDToTypeID( "Ordn" );
var idTrgt = charIDToTypeID( "Trgt" );
ref1.putEnumerated( idLyr, idOrdn, idTrgt );
desc9.putReference( idnull, ref1 );
var idT = charIDToTypeID( "T " );
var desc10 = new ActionDescriptor();
var idScl = charIDToTypeID( "Scl " );
var idPrc = charIDToTypeID( "#Prc" );
desc10.putUnitDouble( idScl, idPrc, 100.000000 );
var idSoFi = charIDToTypeID( "SoFi" );
var desc11 = new ActionDescriptor();
var idenab = charIDToTypeID( "enab" );
desc11.putBoolean( idenab, true );
var idpresent = stringIDToTypeID( "present" );
desc11.putBoolean( idpresent, true );
var idshowInDialog = stringIDToTypeID( "showInDialog" );
desc11.putBoolean( idshowInDialog, true );
var idMd = charIDToTypeID( "Md " );
var idBlnM = charIDToTypeID( "BlnM" );
var idNrml = charIDToTypeID( "Nrml" );
desc11.putEnumerated( idMd, idBlnM, idNrml );
var idClr = charIDToTypeID( "Clr " );
var desc12 = new ActionDescriptor();
var idRd = charIDToTypeID( "Rd " );
desc12.putDouble( idRd, 213.996735 );
var idGrn = charIDToTypeID( "Grn " );
desc12.putDouble( idGrn, 213.996735 );
var idBl = charIDToTypeID( "Bl " );
desc12.putDouble( idBl, 213.996735 );
var idRGBC = charIDToTypeID( "RGBC" );
desc11.putObject( idClr, idRGBC, desc12 );
var idOpct = charIDToTypeID( "Opct" );
var idPrc = charIDToTypeID( "#Prc" );
desc11.putUnitDouble( idOpct, idPrc, 100.000000 );
var idSoFi = charIDToTypeID( "SoFi" );
desc10.putObject( idSoFi, idSoFi, desc11 );
var idLefx = charIDToTypeID( "Lefx" );
desc9.putObject( idT, idLefx, desc10 );
executeAction( idsetd, desc9, DialogModes.NO );
// =======================================================
It only works with a single selected layer or group (not multiple selected layers/groups), and what I'd like to be able to do if possible is instead of having the colour specified within the script, grab the colour from the system clipboard (I guess as a variable) in a RGB HEX format (e.g. I'd already have something like this copied to the clipboard #AE2993 before running the script), and also be able to run it on multiple selected layers.
Is something like this even possible?
