Copy link to clipboard
Copied
Hi all,
I am having 2 javascripts (eg: spt1.jsx,spt2.jsx). I am running the 2nd one from 1st script by doScript function. but i want to pass a value (input to a variable to 2nd script from 1st script. can we do this ?
Ganesh Jeevaa
Copy link to clipboard
Copied
Here is an example:
spt1.jsx
var parameters = ["Hello, I am spt1.jsx", "Blah-blah-blah."];
var jsFile = new File("~/Desktop/spt2.jsx");
app.doScript(jsFile, ScriptLanguage.javascript, parameters);
spt2.jsx
alert("First argument: " + arguments[0] + "\rSecond argument: " + arguments[1], "This is spt2.jsx");
Hope it helps.
Kas
Copy link to clipboard
Copied
There is also app.scriptArgs that you could use for this…
Find more inspiration, events, and resources on the new Adobe Community
Explore Now