🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #19414

Re: New to apple script... is this worth a try?

#19414
From: Dave Saunders
Date: Wed, 18 Dec 2002 12:56
32 lines
2091 bytes
AppleScript Studio is very powerful but overkill for getting started with scripting.

Set simple goals first and just use Script Editor.

Here's how I tackle mysterious problems:

Make a new Editor window.

Open the Results window.

Type one line commands in the new window and see what the result is.

For instance, say you can't understand why:

tell application "InDesign 2.0.2"
 set myPara to paragraph 1 of parent story of selection
 -- [snip]
end tell

Doesn't seem to work the way you expect it (later references to myPara either give errors or the wrong result).

Well, type that line into a separate script window and try it and you'll see that myPara contains the text of the paragraph not a reference to it.

The line ought to read:

set myPara to object reference of paragraph 1 of parent story of selection

This is a simple example, but this technique has helped me with many, many issues.

AppleScript Studio is what you'll need to build complex user interfaces for your scripts. It is very challenging in its own regard and will distract you away from InDesign is you try to start with it. You'll put too much effort into trying to make buttons or popups work and will forget that you don't really need an interface for most scripts.

Dave
Technical Details
Message-ID: <1de70da9.2@WebX.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-09!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.icl.net!newsfeed.fjserv.net!skynet.be!skynet.be!newsfeed.tpinternet.pl!newsfeed01.sul.t-online.de!t-online.de!WebX
References: <1de70da9.-1@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-18 05:28:28 PST
From: "Dave Saunders" <daves@pdsassoc.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-09!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.icl.net!newsfeed.fjserv.net!skynet.be!skynet.be!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: <1de70da9.2@WebX.la2eafNXanI>
Date: Wed, 18 Dec 2002 04:56:17 -0800
References: <1de70da9.-1@WebX.la2eafNXanI>
Lines: 42
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit