Article View: adobe.scripting.indesign
Article #8228Re: Is there a script to call other scripts? (IDCS2 - Windows)
From: Dave_Saunders
Date: Wed, 25 Oct 2006 00:41
Date: Wed, 25 Oct 2006 00:41
22 lines
1293 bytes
1293 bytes
Here's one way to do it. In this case, this script calls the other script at the end of doing its thing.
var otherScript = File(getScriptPath().parent.absoluteURI + "/Other.jsx");
if (!otherScript.exists) {
// This clicks in only if you change the name of the script or move it
var otherScript = File.openDialog("Please locate the other script");
if (otherScript == null) { exit() } // User canceled
}
app.doScript(otherScript);
function getScriptPath() {
// This function returns the path to the active script, even when running ESTK
try {
return app.activeScript;
} catch(e) {
return File(e.fileName);
}
}
Dave
Technical Details
Message-ID:
<3bc2123e.0@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news2.volia.net!news.ecp.fr!news.stben.net!webcrossingReferences:
<3bc2123e.-1@webcrossing.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,77f7c86b6fbab8c8 X-Google-Attributes: gidf939a,public X-Google-Language: ENGLISH,ASCII-7-bit From: Dave_Saunders@adobeforums.com Newsgroups: adobe.scripting.indesign Subject: Re: Is there a script to call other scripts? (IDCS2 - Windows) Message-ID: <3bc2123e.0@webcrossing.la2eafNXanI> Date: Tue, 24 Oct 2006 17:41:03 -0700 References: <3bc2123e.-1@webcrossing.la2eafNXanI> Lines: 23 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news2.volia.net!news.ecp.fr!news.stben.net!webcrossing