Hey everyone, I have a photoshop document full of “Embedded Smart Objects”. My goal is to extract the text inside them. In Photoshop, I use “Convert to Layers” and then get access to the text. I am working on a UXP Plugin to do this but couldn’t find how! So far, I’ve been able to identify and log the smart objects, but not to extract the layers
Hey, I found a similar post here on the forum. Will this work for you?
Looking into it now! Sadly getting errors from that solution: “operation “Convert To Layers” is not currently available”
Hey, if you record an action for the Convert to Layers
menu item and then click Copy as JavaScript
from the Actions Panel menu you’ll get the code below which successfully converts the smart object back into layers. Try it out and let me know if you have any issues.
async function convertToLayers() {
let commands = [
// Convert To Layers
{
"_obj": "placedLayerConvertToLayers"
}
];
return await require("photoshop").action.batchPlay(commands, {});
}
console.log(
await require("photoshop").core.executeAsModal(convertToLayers, {"commandName": "Action Commands"})
);
Thanks! Will try now. How did you record the action?
See the Adobe Photoshop docs for Creating and recording actions.
1 Like