🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #20094

Re: Script to L and R styles

#20094
From: Dave Saunders
Date: Tue, 29 Oct 2002 20:12
36 lines
2157 bytes
Couldn't find it! 

So I produced it again. This is an improved version. It allows for you to do edits after the fact that shuffle paragraphs on to wrong pages. If that happens, rerun the script and it will fix all the LHs and RHs as needed -- note that it ignores all other paragraphs. 

Also, I've not tested the error stuff. It's possible that the selection won't be visible on screen when the dialog appears -- that's something of a problem with this kind of error reporting. 

Here's the script: 



tell application "InDesign 2.0.1" 
 set myStory to parent of selection 
 set theLim to count of paragraphs of myStory 
 repeat with n from 1 to theLim 
  set theName to name of applied paragraph style of paragraph n of myStory 
  if theName is "RH" or theName is "LH" then 
   try 
    set thePage to (name of parent of parent text frame of paragraph n of myStory) as integer 
    if thePage mod 2 = 1 then 
     set applied paragraph style of paragraph n of myStory to paragraph style "RH" of document 1 
    else 
     set applied paragraph style of paragraph n of myStory to paragraph style "LH" of document 1 
    end if 
   on error 
    activate 
    select paragraph n of myStory 
    display dialog "Selected paragraph spans two pages" 
    return 
   end try 
  end if 
 end repeat 
end tell



Dave
Technical Details
Message-ID: <1de65879.4@WebX.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-04!supernews.com!newsfeed.news2me.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.fjserv.net!opentransit.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
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2002-10-29 12:44:02 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-04!supernews.com!newsfeed.news2me.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.fjserv.net!opentransit.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.4@WebX.la2eafNXanI>
Date: Tue, 29 Oct 2002 12:12:51 -0800
References: <1de65879.-1@WebX.la2eafNXanI>
Lines: 41
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit