Answered
Script: convert path to shape layer not working
With javascript, I was trying to convert a path into a shape layer, with a red fill. I recorded the below script, with ScriptListner, but when run, it does nothing. Any ideas or workarounds?
var idMk = charIDToTypeID( "Mk " );
var desc340 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref21 = new ActionReference();
var idcontentLayer = stringIDToTypeID( "contentLayer" );
ref21.putClass( idcontentLayer );
desc340.putReference( idnull, ref21 );
var idUsng = charIDToTypeID( "Usng" );
var desc341 = new ActionDescriptor();
var idType = charIDToTypeID( "Type" );
var desc342 = new ActionDescriptor();
var idClr = charIDToTypeID( "Clr " );
var desc343 = new ActionDescriptor();
var idRd = charIDToTypeID( "Rd " );
desc343.putDouble( idRd, 255.000000 );
var idGrn = charIDToTypeID( "Grn " );
desc343.putDouble( idGrn, 0.000000 );
var idBl = charIDToTypeID( "Bl " );
desc343.putDouble( idBl, 0.000000 );
var idRGBC = charIDToTypeID( "RGBC" );
desc342.putObject( idClr, idRGBC, desc343 );
var idsolidColorLayer = stringIDToTypeID( "solidColorLayer" );
desc341.putObject( idType, idsolidColorLayer, desc342 );
var idShp = charIDToTypeID( "Shp " );
var desc344 = new ActionDescriptor();
var idTrgp = charIDToTypeID( "Trgp" );
var idPthK = charIDToTypeID( "PthK" );
var idTrgp = charIDToTypeID( "Trgp" );
desc344.putEnumerated( idTrgp, idPthK, idTrgp );
var idpathClass = stringIDToTypeID( "pathClass" );
desc341.putObject( idShp, idpathClass, desc344 );
var idstrokeStyle = stringIDToTypeID( "strokeStyle" );
var desc345 = new ActionDescriptor();
var idstrokeStyleVersion = stringIDToTypeID( "strokeStyleVersion" );
desc345.putInteger( idstrokeStyleVersion, 2 );
var idstrokeEnabled = stringIDToTypeID( "strokeEnabled" );
desc345.putBoolean( idstrokeEnabled, false );
var idfillEnabled = stringIDToTypeID( "fillEnabled" );
desc345.putBoolean( idfillEnabled, true );
var idstrokeStyleLineWidth = stringIDToTypeID( "strokeStyleLineWidth" );
var idPxl = charIDToTypeID( "#Pxl" );
desc345.putUnitDouble( idstrokeStyleLineWidth, idPxl, 1.000000 );
var idstrokeStyleLineDashOffset = stringIDToTypeID( "strokeStyleLineDashOffset" );
var idPnt = charIDToTypeID( "#Pnt" );
desc345.putUnitDouble( idstrokeStyleLineDashOffset, idPnt, 0.000000 );
var idstrokeStyleMiterLimit = stringIDToTypeID( "strokeStyleMiterLimit" );
desc345.putDouble( idstrokeStyleMiterLimit, 100.000000 );

