🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #258

Re: Find based on style in CS2

#258
From: Glen_Bal
Date: Thu, 19 Mar 2009 09:30
19 lines
1173 bytes
Hi,

Is this what you want:

var myDoc = app.activeDocument;
var myStyles = myDoc.paragraphStyles;
var mySlen = myStyles.length;

for (var a=0; mySlen > a; a++) {
	try {
		alert("Paragraph style " + myStyles[a].name + " " + myStyles[a].basedOn.name);
	} catch (e) {	alert("Paragraph style " + myStyles[a].name + " undefined");	}
}

I don't know why you made the big construction when you can get the name of the basedOn with no extra effort. But that could be me.
I have inserted a try-catch because you get an error when you take a basedOn of a root paragraph style.

Greetz,
Glen
Technical Details
Message-ID: <59b83b0b.0@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newshub.sdsu.edu!webcrossing
References: <59b83b0b.-1@webcrossing.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,fcb4ba3ed0cb3ee3
X-Google-Attributes: gidf939a,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: Glen_Bal@adobeforums.com
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newshub.sdsu.edu!webcrossing
Newsgroups: adobe.scripting.indesign
Subject: Re: Find based on style in CS2
Message-ID: <59b83b0b.0@webcrossing.la2eafNXanI>
Date: Thu, 19 Mar 2009 02:30:57 -0700
References: <59b83b0b.-1@webcrossing.la2eafNXanI>
Lines: 23
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit