I'm able to get the File Reference of an embedded Smart Object Layer but I was wondering how to execute the corresponding ActionDescriptor to modify that specific string.
I know that Photoshop changes the name of the temporary PSB file appending numbers every time it's contents gets edited (if there are repeated files sharing the same name at the temp folder). I need more descriptive SmartObject filenames for PSDs already created.
Here my function that returns that string stored at the key4 (fileReference) of desc2 (smartObject)
Still learning how ActionDescriptors / Action Manager Code / Kevlar API works.
Code: Select all
function getFileReference() {
var ref = new ActionReference();
ref.putEnumerated(charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt"));
var desc1 = executeActionGet(ref);
var desc2 = desc1.getObjectValue(stringIDToTypeID('smartObject'));
return desc2.getString(desc2.getKey(4));
}