Include XX.jsx script file in XX1.jsx.
Not directly, but you could pass a variable value using insertLabel() and extractLabel() methods.
I.e. in your parent script:
app.insertLabel("name", x.substr(0, x.lastIndexOf('.')) );
in your child script:
myPassedVar = app.extractLabel("name");
if you want to store something e.g. a value or a string
you can define an targetengine with a specific name of you choice
this engine will exist until you close InDesign.
for example run this script in InDesign:
#targetengine "session01" var myValue = 0; alert(myValue); myValue++;
than this one
#targetengine "session01" alert(myValue);
InDesign will alert “0” at first as declared
the second script will alert “1”
because “myValue” was stored by the targetengine “session1”
and got incremented at the end of script one
with now targetengine declared InDesign will create at launch his own engine
and destroy that after the script execution
Yet another method is to use a script argument. In XX.jsx you can include this line:
app.scriptArgs.set ('fvar', x.substr(0, x.lastIndexOf('.')));
Then in XX1.jsx you do as follows:
var fname = app.scriptArgs.get ('fvar');
Spoilt for choice!
Or in a more dirty manner, generate a temp file to store datas. But Peter's hint is teh best option
Good think is to check if the script argument is defined:
if ( app.scriptArgs.isDefined ( 'fvar' ) ) var fname = app.scriptArgs.get ('fvar'); else alert ( "fvar is not defined!" );