I have a Work Path I'd like to convert into a shape layer. It can be done through the UI by pressing the "Shape" button at the Pen tool menu as shown in this answer.
How do I do that through scripting?
I used the Script Listener to capture it, but the output doesn't contain the converting function:
// =======================================================
// Select Work Path
var idslct = charIDToTypeID( "slct" );
var desc6704 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref4022 = new ActionReference();
var idPath = charIDToTypeID( "Path" );
var idWrPt = charIDToTypeID( "WrPt" );
ref4022.putProperty( idPath, idWrPt );
desc6704.putReference( idnull, ref4022 );
executeAction( idslct, desc6704, DialogModes.NO );
// =======================================================
// Select Pen Tool
var idslct = charIDToTypeID( "slct" );
var desc6705 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref4023 = new ActionReference();
var idpenTool = stringIDToTypeID( "penTool" );
ref4023.putClass( idpenTool );
desc6705.putReference( idnull, ref4023 );
var iddontRecord = stringIDToTypeID( "dontRecord" );
desc6705.putBoolean( iddontRecord, true );
var idforceNotify = stringIDToTypeID( "forceNotify" );
desc6705.putBoolean( idforceNotify, true );
executeAction( idslct, desc6705, DialogModes.NO );
// The End.
I tried to cheat and record it as an Action to trigger through the script, but unsurprisingly transforming Paths into Shapes doesn't get recorded as Action either.
Is there a way to capture and reproduce this action programmatically at all without creating junk custom shapes?