Copy link to clipboard
Copied
Below is my example that doesn't work. I have a lot of on local machine files for Illustrator, to have them appear in a menu, and I'm wondering if I am able to use a variable with #include since the path can be long. Is this possible?
scriptingPath = "/Volumes/work/_Resources/_Apps/adobe_scripts/";
#include scriptingPath + "delete_layers.jsx";
Copy link to clipboard
Copied
have you tried removing the space at the start of the variables string?
i would expect that to work.
so i would be looking at syntax.
could it be something like.
scPath = new Folder ("path goes here");
only on phone so can check now. will look when back at pc.
Copy link to clipboard
Copied
Instead of using #include, you can use eval(File()) , or $.evalFile(File()) to bring in some code.
Copy link to clipboard
Copied
Hi, please try
#includepath "/Volumes/work/_Resources/_Apps/adobe_scripts/";
#include "delete_layers.jsx";
Copy link to clipboard
Copied
I realise now after seeing the correct solution from moluapple​ that the "#" is not true Javascript.
So for some reason does not pass javascript variables.
Like thread here from a few years back:[JS CS3] Making the #includepath work
thanks moluapple,