Article View: adobe.scripting.indesign
Article #267Re: AppleScript do script to run a JavaScript
From: Kasyan_Servetsky
Date: Thu, 19 Mar 2009 16:12
Date: Thu, 19 Mar 2009 16:12
23 lines
1361 bytes
1361 bytes
Does the JavaScript have to be inside this directory for it to run on
a Mac?
No. You can just copy js code from ESTK and assign it to the variable in script editor, placing it inside double quotes. e.g.
set myJsScript to "target indesign
var myDoc = app.activeDocument;
...
...
// end of JS code "
But be sure to use single quotes inside JS then.
e.g. var myString = 'Blah-blah-blah';
not var myString = "Blah-blah-blah";
You can even send and – if my memory serves me right – receive back parameters (aka arguments). If you are interested I can post an example or send you a script that uses this functionality.
Kasyan
Technical Details
Message-ID:
<59b8585f.3@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!newshub.sdsu.edu!webcrossingReferences:
<59b8585f.-1@webcrossing.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,9e87ebc19aa2c8b1 X-Google-Attributes: gidf939a,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: Kasyan_Servetsky@adobeforums.com Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!newshub.sdsu.edu!webcrossing Newsgroups: adobe.scripting.indesign Subject: Re: AppleScript do script to run a JavaScript Message-ID: <59b8585f.3@webcrossing.la2eafNXanI> Date: Thu, 19 Mar 2009 09:12:16 -0700 References: <59b8585f.-1@webcrossing.la2eafNXanI> Lines: 19 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit