Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Help me in doScript

New Here ,
Apr 19, 2011 Apr 19, 2011

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

TOPICS
Scripting
460
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Apr 20, 2011 Apr 20, 2011

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Apr 20, 2011 Apr 20, 2011
LATEST

There is also app.scriptArgs that you could use for this…

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines