Need to replace an image with an image from a URL using extendscript
I am making a script to automatically generate a thumbnail by opening a template PSD and editing the contents based on data from an API, and one of those contents is a background image. I can't find a way to get an image from a URL and replace the contents of a layer with said image. The closest thing I've come across is this script
which works with smart objects, but it gives me an error when I try and convert a layer to a smart object like this:
I need either a way to convert the layer to a smart object, or just a totally different and easier way to replace a layer with an image.
