🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #17504

This is a bug isn't it?

#17504
From: Richard Ronnback
Date: Sat, 31 May 2003 09:27
20 lines
1830 bytes
I am trying to get some statistics from a document. I thought I could use the find command to count paragraph/character styles usage. The problem is I get "1" as the result both when the style isn't used and when it is used just once in the document. That means I can't distungish between the two.

To see what I mean try this with an empty document that has a paragraph style defined but not used, then apply the style to one paragraph and run the script again. As you will notice you get the same result.



 
tell application "InDesign 2.0.2" 
	set myDoc to active document 
	set myParaStyles to paragraph styles of myDoc 
	set myParaUse to 0 
	set myParaUsage to "PARAGRAPH STYLE USAGE" & return 
	set find preferences to nothing 
	repeat with i from 2 to count of myParaStyles 
		set properties of find preferences to {applied paragraph style:item i of myParaStyles} 
		set myCount to count of (search myDoc for "") 
		set myParaUse to myParaUse + myCount 
		set myParaUsage to myParaUsage & (name of item i of myParaStyles) & tab & myCount & return 
	end repeat 
end tell 
Technical Details
Message-ID: <1de9585e.-1@WebX.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-09!supernews.com!diablo.theplanet.net!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f939a,b348e5a7055ddbc9,start
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2003-05-31 02:37:37 PST
From: "Richard Ronnback" <richard.ronnback@telia.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-09!supernews.com!diablo.theplanet.net!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX
Newsgroups: adobe.scripting.indesign
Subject: This is a bug isn't it?
Message-ID: <1de9585e.-1@WebX.la2eafNXanI>
Date: Sat, 31 May 2003 02:27:48 -0700
Lines: 27
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit