🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #20180

Re: Script to L and R styles

#20180
From: Dave Saunders
Date: Mon, 28 Oct 2002 13:02
23 lines
1883 bytes
Vern, 

Not that hard to do, but: what do you want to do about paragraphs that span from one page to the next? 

The basic technique, assuming that all the paragraphs are in the same story is: 

1. Have the user click an insertion point in the story. 

2. Set myStory to parent of insertion point. 

3. For each paragraph of myStory: 

a. Check that the name of its applied paragraph style is "RH" and if so: 

b. Get the parent text frame of the paragraph (check for an error here: if the paragraph spans two frames then you'll get an error and you'll have to decide what to do about it). 

c. Get the name of the parent of the text frame (i.e., the page number) and check to see if it's an even page using the mod operator. If it is, then: 

d. Set the applied paragraph style of the paragraph to paragraph style "LH" of document 1. 

That'll do it. I checked the above by actually writing the script, but you sound as though you want to do the actual writing yourself, so I'll not post my script unless you'd like me to. 

Dave
Technical Details
Message-ID: <1de65879.0@WebX.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-08!sn-xit-04!supernews.com!newsfeed.news2me.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.fjserv.net!proxad.net!proxad.net!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!WebX
References: <1de65879.-1@WebX.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f939a,d9c9de30f1cb23b1,start
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2002-10-28 06:58:09 PST
From: "Dave Saunders" <daves@pdsassoc.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-08!sn-xit-04!supernews.com!newsfeed.news2me.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.fjserv.net!proxad.net!proxad.net!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!WebX
Newsgroups: adobe.scripting.indesign
Subject: Re: Script to L and R styles
Message-ID: <1de65879.0@WebX.la2eafNXanI>
Date: Mon, 28 Oct 2002 05:02:29 -0800
References: <1de65879.-1@WebX.la2eafNXanI>
Lines: 33
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit