Copy link to clipboard
Copied
I want to pass my_path = app.activeDocument.path, to second script
The first script is
#targetengine "my_path"
my_path = app.activeDocument.path;
The second script is
#targetengine "my_path"
alert(my_path);
Testing on different documents.
Running the scripts from menu File>Scripts the alert gives the corresponding document path
Running the first script from recorded action the alert gives the first document path
How I can have the corresponding document path , while running the first script from a recorded action ?
Without using actions you could try evalFile() method, with, you may try $.setenv / $.getenv methods.
Copy link to clipboard
Copied
Without using actions you could try evalFile() method, with, you may try $.setenv / $.getenv methods.
Copy link to clipboard
Copied
Using $.setenv / $.getenv methods works fine with actions !
Thank you!
1st script
$.setenv("my_path" ,app.activeDocument.path);
2nd script
var myFolder_doc = $.getenv("my_path")