Script listener assistance.
Hi,
This is the 1st time I use script listener though i already wrote quite a few scripts.
I wanted to add a drop shadow to a layer and tried the script listener.
I have layers:
Layer 3, Layer 1 & TEST.
I recorded only the following actions:
1. Select layer TEST
2. apply only drop shadow
I go the following result from script listener.
What are the basic steps i need to perform in order to implement this in my script, turning it into a function which adds drop shadow?
Thanks
// =======================================================
var idslct = charIDToTypeID( "slct" );
var desc48 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref22 = new ActionReference();
var idLyr = charIDToTypeID( "Lyr " );
ref22.putName( idLyr, "TEST" );
desc48.putReference( idnull, ref22 );
var idMkVs = charIDToTypeID( "MkVs" );
desc48.putBoolean( idMkVs, false );
var idLyrI = charIDToTypeID( "LyrI" );
var list12 = new ActionList();
list12.putInteger( 6 );
desc48.putList( idLyrI, list12 );
executeAction( idslct, desc48, DialogModes.NO );
// =======================================================
var idmodalStateChanged = stringIDToTypeID( "modalStateChanged" );
var desc49 = new ActionDescriptor();
var idLvl = charIDToTypeID( "Lvl " );
desc49.putInteger( idLvl, 1 );
var idStte = charIDToTypeID( "Stte" );
var idStte = charIDToTypeID( "Stte" );
var identer = stringIDToTypeID( "enter" );
desc49.putEnumerated( idStte, idStte, identer );
var idkcanDispatchWhileModal = stringIDToTypeID( "kcanDispatchWhileModal" );
desc49.putBoolean( idkcanDispatchWhileModal, true );
var idTtl = charIDToTypeID( "Ttl " );
desc49.putString( idTtl, """Layer Style""" );
executeAction( idmodalStateChanged, desc49, DialogModes.NO );
// =======================================================
var idmodalStateChanged = stringIDToTypeID( "modalStateChanged" );
var desc50 = new ActionDescriptor();
var idLvl = charIDToTypeID( "Lvl " );
desc50.putInteger( idLvl, 0 );
var idStte = charIDToTypeID( "Stte" );
var idStte = charIDToTypeID( "Stte" );
var idexit = stringIDToTypeID( "exit" );
desc50.putEnumerated( idStte, idStte, idexit );
var idkcanDispatchWhileModal = stringIDToTypeID( "kcanDispatchWhileModal" );
desc50.putBoolean( idkcanDispatchWhileModal, true );
var idTtl = charIDToTypeID( "Ttl " );
desc50.putString( idTtl, """Layer Style""" );
executeAction( idmodalStateChanged, desc50, DialogModes.NO );
// =======================================================
var idsetd = charIDToTypeID( "setd" );
var desc51 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref23 = new ActionReference();
var idPrpr = charIDToTypeID( "Prpr" );
var idLefx = charIDToTypeID( "Lefx" );
ref23.putProperty( idPrpr, idLefx );
var idLyr = charIDToTypeID( "Lyr " );
var idOrdn = charIDToTypeID( "Ordn" );
var idTrgt = charIDToTypeID( "Trgt" );
ref23.putEnumerated( idLyr, idOrdn, idTrgt );
desc51.putReference( idnull, ref23 );
var idT = charIDToTypeID( "T " );
var desc52 = new ActionDescriptor();
var idScl = charIDToTypeID( "Scl " );
var idPrc = charIDToTypeID( "#Prc" );
desc52.putUnitDouble( idScl, idPrc, 416.666667 );
var idDrSh = charIDToTypeID( "DrSh" );
var desc53 = new ActionDescriptor();
var idenab = charIDToTypeID( "enab" );
desc53.putBoolean( idenab, true );
var idpresent = stringIDToTypeID( "present" );
desc53.putBoolean( idpresent, true );
var idshowInDialog = stringIDToTypeID( "showInDialog" );
desc53.putBoolean( idshowInDialog, true );
var idMd = charIDToTypeID( "Md " );
var idBlnM = charIDToTypeID( "BlnM" );
var idMltp = charIDToTypeID( "Mltp" );
desc53.putEnumerated( idMd, idBlnM, idMltp );
var idClr = charIDToTypeID( "Clr " );
var desc54 = new ActionDescriptor();
var idRd = charIDToTypeID( "Rd " );
desc54.putDouble( idRd, 0.000000 );
var idGrn = charIDToTypeID( "Grn " );
desc54.putDouble( idGrn, 0.000000 );
var idBl = charIDToTypeID( "Bl " );
desc54.putDouble( idBl, 0.000000 );
var idRGBC = charIDToTypeID( "RGBC" );
desc53.putObject( idClr, idRGBC, desc54 );
var idOpct = charIDToTypeID( "Opct" );
var idPrc = charIDToTypeID( "#Prc" );
desc53.putUnitDouble( idOpct, idPrc, 35.000000 );
var iduglg = charIDToTypeID( "uglg" );
desc53.putBoolean( iduglg, true );
var idlagl = charIDToTypeID( "lagl" );
var idAng = charIDToTypeID( "#Ang" );
desc53.putUnitDouble( idlagl, idAng, 90.000000 );
var idDstn = charIDToTypeID( "Dstn" );
var idPxl = charIDToTypeID( "#Pxl" );
desc53.putUnitDouble( idDstn, idPxl, 5.000000 );
var idCkmt = charIDToTypeID( "Ckmt" );
var idPxl = charIDToTypeID( "#Pxl" );
desc53.putUnitDouble( idCkmt, idPxl, 1.000000 );
var idblur = charIDToTypeID( "blur" );
var idPxl = charIDToTypeID( "#Pxl" );
desc53.putUnitDouble( idblur, idPxl, 5.000000 );
var idNose = charIDToTypeID( "Nose" );
var idPrc = charIDToTypeID( "#Prc" );
desc53.putUnitDouble( idNose, idPrc, 0.000000 );
var idAntA = charIDToTypeID( "AntA" );
desc53.putBoolean( idAntA, false );
var idTrnS = charIDToTypeID( "TrnS" );
var desc55 = new ActionDescriptor();
var idNm = charIDToTypeID( "Nm " );
desc55.putString( idNm, """Linear""" );
var idShpC = charIDToTypeID( "ShpC" );
desc53.putObject( idTrnS, idShpC, desc55 );
var idlayerConceals = stringIDToTypeID( "layerConceals" );
desc53.putBoolean( idlayerConceals, true );
var idDrSh = charIDToTypeID( "DrSh" );
desc52.putObject( idDrSh, idDrSh, desc53 );
var idLefx = charIDToTypeID( "Lefx" );
desc51.putObject( idT, idLefx, desc52 );
executeAction( idsetd, desc51, DialogModes.NO );

]