I am trying to replace the content of a smart object layer with the following function.
I can’t get the proper token for the “placedLayerReplaceContents”
Do I need a special function to Get File For Placing or ???
Can someone help?
const batchPlay = require(“photoshop”).action.batchPlay
const app = require(“photoshop”).app
const UXP = require(“uxp”)const fs = require(“uxp”).storage.localFileSystem
var exeModal = require(“photoshop”).core.executeAsModal
var theFile
var myFileconst test3 = async () => {
await exeModal(async () => {
theFile = await fs.getFileForOpening();
myFile = theFile.nativePath
console.log(myFile)const result = await batchPlay(
[
{
_obj: “placedLayerReplaceContents”,
null: {
_kind: “local”,
_path: myFile
},
_options: {
dialogOptions: “display”
}
}
],{
synchronousExecution: false,
modalBehavior: “execute”
})
})
}