Javascript to Convert an embedded smart object to linked via save as dialog
Hello and thanks to any who reply,
I am trying to create a script that converts the selected embedded smart object layer into a linked smart object by bringing up a "save as" dialog so the user can direct where to saved the linked smart object to, each time the script runs. So far I've been able to find this script which converts an embedded smart object to a linked smart object and saves it to a predefined path:
var filePath = "/Insert/Your/Path/To/Linked/File.psd"
LinkedSmart( filePath )
function LinkedSmart( filePath )
{
var idplacedLayerConvertToLinked = stringIDToTypeID( "placedLayerConvertToLinked" );
var desc31 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref12 = new ActionReference();
var idLyr = charIDToTypeID( "Lyr " );
var idOrdn = charIDToTypeID( "Ordn" );
var idTrgt = charIDToTypeID( "Trgt" );
ref12.putEnumerated( idLyr, idOrdn, idTrgt );
desc31.putReference( idnull, ref12 );
var idUsng = charIDToTypeID( "Usng" );
desc31.putPath( idUsng, new File( filePath ) );
executeAction( idplacedLayerConvertToLinked, desc31, DialogModes.NO );
}
Any help would be greatly appreciated. Thank you,
-Floyd
[Moved from Photoshop forum to Photoshop Scripting Forum by Mod]
