🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #10137

Re: Javascript paragraph next styles

#10137
From: Martin Fischer*
Date: Thu, 06 Jul 2006 14:14
34 lines
1742 bytes
Hi Bret,

here is an example to do this:

 
var myDoc = app.documents[0]; 
var mySel = app.selection[0];

var myPStyle1 = "Petit"; 
var myPStyle2 = "Normal";

// apply paragraph style to selected paragraphs 
mySel.appliedParagraphStyle = myDoc.paragraphStyles.item (myPStyle1);

// apply paragraph style to paragraph after selected paragraphs

//1. another paragraph style 
mySel.paragraphs[-1].insertionPoints[-1].appliedParagraphStyle =  myDoc.paragraphStyles.item (myPStyle2);

//2. the paragraph styles next style 
mySel.paragraphs[-1].insertionPoints[-1].paragraphs[0].insertionPoints[-1].appliedParagraphStyle =  myDoc.paragraphStyles.item (myPStyle2).nextStyle; 




You can adress the paragraph after the selected paragraphs with

mySel.paragraphs[-1].insertionPoints[-1].paragraphs[0]

or simple adress the first insertion point of the pargraph after the selected paragraphs (to apply him a paragraph style:

mySel.paragraphs[-1].insertionPoints[-1]

Martin
Technical Details
Message-ID: <3bc0d401.0@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!193.190.198.17.MISMATCH!syros.belnet.be!news.belnet.be!news.stben.net!webcrossing
References: <3bc0d401.-1@webcrossing.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,7c9f8fce2e9b3eab
X-Google-Attributes: gidf939a,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Martin Fischer*" <martin.fischer@online.de>
Newsgroups: adobe.scripting.indesign
Subject: Re: Javascript paragraph next styles
Message-ID: <3bc0d401.0@webcrossing.la2eafNXanI>
Date: Thu, 6 Jul 2006 07:14:17 -0700
References: <3bc0d401.-1@webcrossing.la2eafNXanI>
Lines: 35
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!193.190.198.17.MISMATCH!syros.belnet.be!news.belnet.be!news.stben.net!webcrossing