Article View: adobe.scripting.indesign
Article #18808Re: indesign-scripting : Style Creation
From: BATTISTELLI Laurent
Date: Wed, 19 Feb 2003 07:55
Date: Wed, 19 Feb 2003 07:55
86 lines
4211 bytes
4211 bytes
thanks Ole
I think I see how to manage this
Is not necessary that you send an example
if I'm not wrong I will, to copy all my characters style , have to make
like this
For j = 2 To myStyleDocument.CharStyles.Count
Set existingCharac = myStyleDocument.CharStyles.Item(j)
Set mynewCharac = mydocument.CharStyles.Add
With mynewCharac
.BaselineShift = existingCharac.BaselineShift
.FigureStyle = existingCharac.FigureStyle
.FillColor = existingCharac.FillColor
.FillTint = existingCharac.FillTint
.FontStyle = existingCharac.FontStyle
.HorizontalScale = existingCharac.HorizontalScale
.KerningMethod = existingCharac.KerningMethod
.KerningValue = existingCharac.KerningValue
.Language = existingCharac.Language
.Leading = existingCharac.Leading
.Ligatures = existingCharac.Ligatures
.Name = existingCharac.Name
.NoBreak = existingCharac.NoBreak
.OTFContextAlt = existingCharac.OTFContextAlt
.OTFDiscLig = existingCharac.OTFDiscLig
.OTFFraction = existingCharac.OTFFraction
.OTFOrdinal = existingCharac.OTFOrdinal
.OTFStylisticAlt = existingCharac.OTFStylisticAlt
.OTFSwash = existingCharac.OTFSwash
.OTFTitling = existingCharac.OTFTitling
.OverprintFill = existingCharac.OverprintFill
.OverprintStroke = existingCharac.OverprintStroke
.PointSize = existingCharac.PointSize
.Position = existingCharac.Position
.Skew = existingCharac.Skew
.StrikeThru = existingCharac.StrikeThru
.StrokeColor = existingCharac.StrokeColor
.StrokeTint = existingCharac.StrokeTint
.StrokeWeight = existingCharac.StrokeWeight
.Tracking = existingCharac.Tracking
.Underline = existingCharac.Underline
.VerticalScale = existingCharac.VerticalScale
End With
Next j
' .Parent = existingCharac.Parent
'.AppliedFont = existingCharac.AppliedFont
' .basedOn = existingCharac.basedOn
i just have to manage the applied font because when I create my new
style the type of this option is variant/long instead of variant/long
the parent information is not necesarry i think
and once I will have finish my creation I will make a loop to complete
for all style the basedon option
because this option need that the basedon style was created
is this right ?
And I will do the same (with some changes like the dependencies ) for
the paragrapg style
wait for any suggestion
have a nice day
Olav Kvern a οΏ½crit:
> Laurent--
>
> Yes, you have to get and set each property of the object to copy the style from one document to another. (Actually, you could use TLBINF.DLL to avoid listing all properties, but it would be way more complicated.)
>
> With character styles, you have to remember that properties will sometimes have a value (e.g., a font reference for the AppliedFont) and sometimes will not--character styles are rarely complete formatting definitions. Character styles record only that formatting which differs from the base formatting of the text. When an attribute in a character style is blank, it's not a long, but an enum: idNothing, or decimal value 1851876449.
>
> I'll post an example function that does what you want in a bit.
>
> Thanks,
>
> Ole
Technical Details
Message-ID:
<3E533878.3040400@comidoc.fr>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebXReferences:
<3E5245FF.9050807@comidoc.fr> <1de7e78f.1@WebX.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: f939a,a7f74efca9b23c0b X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2003-02-19 00:08:04 PST From: BATTISTELLI Laurent <l.battistelli@comidoc.fr> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.scripting.indesign Subject: Re: indesign-scripting : Style Creation Message-ID: <3E533878.3040400@comidoc.fr> Date: Tue, 18 Feb 2003 23:55:36 -0800 References: <3E5245FF.9050807@comidoc.fr> <1de7e78f.1@WebX.la2eafNXanI> Lines: 96 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; fr-FR; rv:1.0.2) Gecko/20021120 Netscape/7.01 X-Accept-Language: fr-fr, fr MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit