atomicSmart Objects
photoshop_replace_smart_object_contents
Replace the embedded contents of a Smart Object layer from an image file. Preserves transforms, warps, and Smart Filters on the layer. Users often say: replace smart object, swap mockup screen, relink embedded file. Use when: updating a mockup or template Smart Object with a new asset file. Do NOT use when: the target is not a Smart Object — convert first or use photoshop_place_image. Do NOT use for linked Smart Objects that need Relink to File — this replaces embedded contents. Returns: JSON { ok, summary, details: { layer_name, file_path } }. Preconditions: Smart Object layer active or named; file_path must exist (absolute). Side effects: replaces embedded pixels.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| file_path | string | yes | Absolute path to the replacement image file (JPEG, PNG, PSD, etc.) |
| layer_name | string | — | Optional exact Smart Object layer name. Default: active layer. |
Community recipes
Nothing here yet. Be the first to share one.
Share a recipe