Paths and prefixes

Absolute paths can be used with any path, but it's not recommended since those may eventually break. If you have a self-contained project folder with relative paths, you can move the folder or send that to anyone without having to redo the paths, much like any example I've set up for this script.

  1. The settings script prefix ($) can be used with: output.path, mockupPath, and input

  2. The mockup file prefix (.) can be used with: output.path, and input

Both of these prefixes support traversing upwards in the folder structure.

~/Desktop/example/settings-script.jsx
// Engine script
#include "Batch Mockup Smart Object Replacement.jsx"
// Points to "~/Desktop/example/Batch Mockup Smart Object Replacement.jsx"
#include "../Batch Mockup Smart Object Replacement.jsx"
// Points to "~/Desktop/Batch Mockup Smart Object Replacement.jsx"

- - - -

// Relative to the settings script
mockupPath: "$/assets/mockup.psd",
// Points to "~Desktop/example/assets/mockup.psd",
mockupPath: "../$/assets/mockup.psd",
// Points to "~Desktop/assets/mockup.psd",

- - - - 

// Relative to the mockup PSD
// Presuming the PSD file is also inside the assets folder
input: "./input files",
// Points to "~Desktop/example/assets/input files",

input: ".././input files",
// Points to "~Desktop/example/input files",

Last updated