Article View: adobe.scripting.indesign
Article #14793Re: Accessing DB
From: Olav_Kvern
Date: Fri, 16 Jan 2004 21:32
Date: Fri, 16 Jan 2004 21:32
13 lines
1823 bytes
1823 bytes
Magnus-- InDesign's JavaScript is built around an Adobe ExtendScript interpreter inside InDesign. It can't communicate with COM objects outside the application. It *can* call VBScripts (or other JavaScripts, or AppleScript on the Mac OS) using the app.doScript method, but a.) you can't pass parameters directly to the scripts you run, and b.) you can't directly get return values back from the scripts you run. What you can do, however, for simple text and numeric data, is to have the "parent" script stuff the data (as strings) into labels before calling the "child" script. The child script can then retrieve the data from the label or labels, do its processing, and then put any return data into the existing labels or create new labels for that purpose. The parent script can then get the data out of the labels. It's a bit clumsy, but it does work. But, for this one, I think you might want to use VB/VBScript, which has quite a lot of built-in support for database access. I almost forgot to mention--if your data is already in comma-delimited or tab delimited text file, you can simply read it from the file using JavaScript's File object. Thanks, Ole
Technical Details
Message-ID:
<2ccf6147.2@webx.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.media.kyoto-u.ac.jp!newsfeed01.sul.t-online.de!t-online.de!webxReferences:
<2ccf6147.-1@webx.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,63bfd66884a90664 X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2004-01-16 13:37:55 PST From: Olav_Kvern@adobeforums.com Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.media.kyoto-u.ac.jp!newsfeed01.sul.t-online.de!t-online.de!webx Newsgroups: adobe.scripting.indesign Subject: Re: Accessing DB Message-ID: <2ccf6147.2@webx.la2eafNXanI> Date: Fri, 16 Jan 2004 13:32:02 -0800 References: <2ccf6147.-1@webx.la2eafNXanI> Lines: 27 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit