🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #845

Re: [CS3 JS] Question about collecting overridden style settings

#845
From: Andreas_Jansson
Date: Thu, 05 Mar 2009 16:14
31 lines
2109 bytes
I guess you mean the toSource() method, but I don't follow quite here, how the properties could be compared - or rather how toSource() can be helpful.

"sr" being the TextStyleRange, the following statement ... 

      sr.properties.toSource()




and the one from its paragraphstyle ...

      sr.paragraphs[0].appliedParagraphStyle.properties.toSource()




... returns partly different things,
obviously since the TextStyleRange contains properties from character styles as well as from paragraph style (and perhaps some of its own). Only the "clean" paragraph style properties would match - can toSource() be helpful making such a comparison?

I guess I could try and make use of the complete toSource() strings of the properties of the paragraph styles as keys (property names) in an associative array (if they are allowed as such - they do get very long), to be able to check for the exact same paragraph style.

But getting the differing style properties only, wouldn't that require checking each property from the text style range object against the corresponding one in the containing paragraph, individually?

(
I also noticed a bug in CS3 - when there is no paragraph style (not the Basic Paragraph but NO paragraph style at all), InD craches when you try to do something with the "properties" object of that TextStyleRange object, such as 

  var srProperties = sr.properties;

)

Andreas
Technical Details
Message-ID: <59b81cad.6@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news.glorb.com!news.astraweb.com!border5.newsrouter.astraweb.com!newshub.sdsu.edu!webcrossing
References: <59b81cad.-1@webcrossing.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,ae48fa806cc37e1a
X-Google-Attributes: gidf939a,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: Andreas_Jansson@adobeforums.com
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news.glorb.com!news.astraweb.com!border5.newsrouter.astraweb.com!newshub.sdsu.edu!webcrossing
Newsgroups: adobe.scripting.indesign
Subject: Re: [CS3 JS] Question about collecting overridden style settings
Message-ID: <59b81cad.6@webcrossing.la2eafNXanI>
Date: Thu, 5 Mar 2009 08:14:35 -0800
References: <59b81cad.-1@webcrossing.la2eafNXanI>
Lines: 36
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit