ianPark
8/23/2019 - 7:56 PM

Place File in Open PSD

// PLACE FILE & RENAME LAYER
function place(docPlacePath, placedLayerName) {
        var desc001 = new ActionDescriptor();
        desc001.putPath( charIDToTypeID( "null" ), new File(docPlacePath) );
        desc001.putEnumerated( charIDToTypeID( "FTcs" ), charIDToTypeID( "QCSt" ), charIDToTypeID( "Qcsa" ) );
        var desc002 = new ActionDescriptor();
        desc002.putUnitDouble( charIDToTypeID( "Hrzn" ), charIDToTypeID( "#Pxl" ), 0.000000 );
        desc002.putUnitDouble( charIDToTypeID( "Vrtc" ), charIDToTypeID( "#Pxl" ), 0.000000 );
        desc001.putObject( charIDToTypeID( "Ofst" ), charIDToTypeID( "Ofst" ), desc002 );
        executeAction( charIDToTypeID( "Plc " ), desc001, DialogModes.NO );
        // NAME NEW LAYER
        app.activeDocument.activeLayer.name = placedLayerName;
}