Usage
Last updated
Was this helpful?
Last updated
Was this helpful?
The script file called Batch Mockup Smart Object Replacement.jsx
, which I also refer to in the documentation as the ”engine” script, takes care of the heavy lifting, and to get it to do its job you need to prepare what I call a ”settings” script.
The settings script needs to include the engine script at the top and then trigger a function with a bunch of settings that tells the engine script which mockup files it should process, what are their smart object target layers, and which input files to use. After that, it’s pretty hands-off.
You can download this repository and modify it to fit your needs. This example is ready to be run as is, but for real-world usage you have to replace a few things here and there:
Add your own mockup PSD file
Change to point towards that file
Change to the smart object layer name in your mockup file.
Then you're technically ready to run the settings script in Photoshop.
While it’s not necessary for initial testing, you will obviously also need to change the input files and possibly customize the settings more to fit your needs.
<- Check the sidebar for more helpful information
Empty project folder
This script is the "engine" that powers the batch process and the only file you need from the Github repo. The examples bump up the repository filesize to around ~100MB, so you may or may not want to download/clone the entire .
This is the file that initiates the batch process and feeds settings to the main "engine" script.
Make sure the #include ...
in the first line points to the engine script file you downloaded. The template is looking for that file right next to the settings script by default. You will also have to customize the settings mockupPath, target, input. Just to be extra clear, fetching the unique target smart object layer name requires you to open the mockup file, hunt down the target layer and possibly renaming it to make sure it is unique.
Just make a plain text file with a .jsx
extension. Copy one of the files from the examples if you can't manage to make a text file otherwise. The filename doesn't matter as long as the extension is .jsx
.
If the mockup file has the "replace this smart object" layer hoisted at the very top of the layers panel and it's hidden, ignore it and target the smart object layer that is already visible to avoid issues. Also it's smart to rename the target smart object layer to make absolute sure the name is unique. Pretty good way is to prefix the layer name with @.
The $
sign prefixing all example paths points to the parent folder of the settings script file itself. There's one more path prefix that points to the mockup psd. You can also use absolute paths but I wouldn't recommend it. Read more about file paths .
The smartObjects[].input
could also be an array. You can find an example of that in and .
There's a separate example repository with a simple example you can find . Additionally check the in the for pretty much the kitchen sink. The examples are all ready to be run as is, but maybe delete the output folders before running the scripts, to see what they do. Maybe fiddle with the input files too.
If you need to add more mockups or smart objects per mockup check the .