Skip to main content
Participant
October 17, 2023
Question

How to change a text layer and smart object in one call using the Photoshop node api

  • October 17, 2023
  • 1 reply
  • 135 views

Hi,

 

Is there a way to both modify document (client.modifyDocument) and replace a smart object (client.replaceSmartObject) in one api call instead of two?

 

Thanks

This topic has been closed for replies.

1 reply

Participating Frequently
October 19, 2023

Yes, use the documentOperation end point.  Supply the edits you want using the layers attribute on the options property.  

In pertinent part:

"layers": [
            {
                "edit": {},
                "name": "Text Layer Name",
                "text": {
                    "content": "Text Goes Here . . ."
                }
            },
            {
                "edit": {},
                "name": "SO Layer Name",
                "smartObject": {},
                "visible": true,
                "input": {
                    "href": "https://drive.google.com/uc?export=download&id=21",
                    "storage": "external"
                }
            }
        ]