🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #832

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

#832
From: Andreas_Jansson
Date: Thu, 05 Mar 2009 12:03
20 lines
1858 bytes
Thanks for the suggestion, Peter. I've found one example of a script dealing with "Italic", "Bold" and "Bold Italic" (which might originate from David Saunders, I'm not sure).
It's described as "Preserve Local Formatting" and looks for ranges without a character style (i.e. with "noCharStyle") but with those specific fontStyles, creating Italic etc, as character styles, and applies them on the text.

These are very specific fontStyle attributes and would not deal with the font size being changed, or the character spacing set to another number between two words etc.

I need to create a more generic code to create character styles for all overridden textstyle ranges in a text.

And now I'm also a bit confused about the nature of the textStyleRange object as well. Looking at its properties some of them have the same names as properties of a characterStyle object, but of different type:

myTextStyleRange.appliedFont.constructor.name
Result: Font

While

myNewCharacterStyle.appliedFont.constructor.name
Result: String

Meaning that I can't directly assign the attributes of the textStyleRange with the overridden styles, to a newly created character style, or is there a way?

Andreas
Technical Details
Message-ID: <59b81cad.2@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!news2.glorb.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!g2news1.google.com!news1.google.com!news.glorb.com!news2.glorb.com!newshub.sdsu.edu!webcrossing
Newsgroups: adobe.scripting.indesign
Subject: Re: [CS3 JS] Question about collecting overridden style settings
Message-ID: <59b81cad.2@webcrossing.la2eafNXanI>
Date: Thu, 5 Mar 2009 04:03:46 -0800
References: <59b81cad.-1@webcrossing.la2eafNXanI>
Lines: 32
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit