Article View: adobe.scripting.indesign
Article #19435Re: New to apple script... is this worth a try?
From: Richard R�nnb�ck
Date: Thu, 19 Dec 2002 18:06
Date: Thu, 19 Dec 2002 18:06
49 lines
3198 bytes
3198 bytes
Rufus, I also began learning scripting quite recently, pretty much from scratch, and there are a few things that really has helped me in understanding what's going on. The first thing I would suggest is to read Ole's excellent introduction to scripting in InDesign's scripting guide. The second is Dave's tip to always have the result window open. And here are some other things I personally find helpful: 1) Do one thing at a time. If you script is supposed to to many things in a row try to make sure that each part works by itself, then later you can combine the parts. 1) make sure you are referring to the right object. For example, the first time I wanted to call a "spread" I simply couldn't do it, because I tried something like "tell active spread of active document..." which doesn't work, because spread belongs to a window, and therefore it should have been "tell active spread of active WINDOW". To find out whether I'm actually calling an object I mostly try "get" first of all - In this case "get active spread of active window" would actually return something meaningful in the result window (the one you should keep open - remember :-) 2) make sure you are using legitimate commands. The "close" command is ok for a document, but not for a layer. The scripting guide will help you find what commands there are. 3) make sure you can get and set properties. For example, if you like to create a guide it helps to first do create a guide in the active document and then tell InDesign to "get properties of guide 1 of active document". That way you can understand what kind of properties there are. Many times you simply just exchange "get" to "set" to change the properties. Note however that properties may be read-only and then can't be set this way. 4) Be patient, it does take some time to learn but I must say I feel it is incredibly rewarding when you succeed. On 02-12-19 16.18, in article 1de70da9.6@WebX.la2eafNXanI, "Rufus Deuchler" <info@rdcomm.net> wrote: > Thanks CouponBoy, > nice example, in the meantime I got to that by myself... I love what this > scripting stuff can do. Yes, the ID scripting guide is an essential resource. > Will look at your post in XChange, > Thanks again and have good holidays, > Ruf
Technical Details
Message-ID:
<BA27C932.B221%richard.ronnback@telia.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.icl.net!newsfeed.fjserv.net!proxad.net!newsfeed.tpinternet.pl!newsfeed01.sul.t-online.de!t-online.de!WebXReferences:
<1de70da9.-1@WebX.la2eafNXanI> <1de70da9.6@WebX.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,3d6763be43015f75 X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2002-12-19 10:08:06 PST From: Richard R�nnb�ck <richard.ronnback@telia.com> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.icl.net!newsfeed.fjserv.net!proxad.net!newsfeed.tpinternet.pl!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.scripting.indesign Subject: Re: New to apple script... is this worth a try? Message-ID: <BA27C932.B221%richard.ronnback@telia.com> Date: Thu, 19 Dec 2002 10:06:26 -0800 References: <1de70da9.-1@WebX.la2eafNXanI> <1de70da9.6@WebX.la2eafNXanI> Lines: 69 User-Agent: Microsoft-Entourage/10.1.1.2418 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit