Article View: adobe.scripting.indesign
Article #14724Re: JS beginners help
From: Dave_Saunders
Date: Mon, 19 Jan 2004 13:00
Date: Mon, 19 Jan 2004 13:00
15 lines
2338 bytes
2338 bytes
Roy, Others beat me to it. The odd thing is that you're running into issues that it took me four months to realize even existed! At first, I did just about everything within the InDesign object model and only used its methods. Of course, I needed JS variables for loops and various odds and ends, but most of the time I just operated on the document's objects (or the application's). Like you, I bought a book. I hope you get more benefit from yours than I did from mine. At first, I visited Microsoft's Jscript <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/js56jsconjscriptfundamentals.asp> site a lot, until I woke up one day and realized that many of the functions it describes aren't the same as the ones supported by InDesign's JavaScript -- in some cases, the JScript function is more capable. Still, in spite of this, I found the site easier to work with than the one I now use at Developer's Edge <http://devedge.netscape.com/library/manuals/2000/javascript/1.5/reference/contents.html>. The DevEdge site is more accurate as an ID JS reference. But, for example, it is organized by object type, so while the Split command is found under String (because the parameter is a string), Join is perversely found under Array because it takes an Array as a parameter. For the longest time, I thought there wasn't a Join command because I couldn't find it. I actually wrote a function to do Join for me. [You use Split and Join in places where in AppleScript you would have used the AppleScript Text Item delimiters.] Keep on trucking! Dave
Technical Details
Message-ID:
<2ccf45cf.41@webx.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.arcor-online.net!newsfeed01.sul.t-online.de!t-online.de!webxReferences:
<2ccf45cf.-1@webx.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,613db9f5b5ffc527 X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2004-01-19 05:07:38 PST From: Dave_Saunders@adobeforums.com Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.arcor-online.net!newsfeed01.sul.t-online.de!t-online.de!webx Newsgroups: adobe.scripting.indesign Subject: Re: JS beginners help Message-ID: <2ccf45cf.41@webx.la2eafNXanI> Date: Mon, 19 Jan 2004 05:00:09 -0800 References: <2ccf45cf.-1@webx.la2eafNXanI> Lines: 34 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit