Article View: adobe.scripting.indesign
Article #19535Re: Changing text kerning
From: Rich Carroll
Date: Mon, 16 Dec 2002 21:02
Date: Mon, 16 Dec 2002 21:02
50 lines
2337 bytes
2337 bytes
I can answer "b" at least. We have people who want to specifically kern type by pairs for a whole document. Once they get a pair such as "tt" kerned exactly the way they like, they want any other instances of "tt" to be kerned the same way. Shane was a great help (as always,) and I've expanded it a bit, but I'm stuck with a coersion problem right now.
tell application "InDesign 2.0.2"
set x to item 1 of selection
set kerningValue to kerning value of x
set theIndex to index of x
set charContents to characters (theIndex - 1) thru theIndex of parent story
of x
set charFontStyle to font style of x
set CharFontSize to point size of x
set charFont to applied font of x
set find preferences to nothing
set change preferences to nothing
search document 1 for charContents with find attributes {applied font:charFont,
point size:CharFontSize, font style:charFontStyle}
set myResult to result
set AppleScript's text item delimiters to ","
repeat with a in myResult
--iterate through all matching pairs, and change kerning only on the second
character in charContents
--kerning is only applied to second character, not pairs
set myChar to a as list
set AppleScript's text item delimiters to space
--having coersion problems here
set myChar to item 7 of myChar
set properties of myChar of parentProps to {kerning value:kerningValue}
end repeat
end tell
Technical Details
Message-ID:
<1de70063.2@WebX.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-09!supernews.com!64.152.100.70.MISMATCH!sjc70.webusenet.com!c03.atl99!news.webusenet.com!newsfeed.icl.net!newsfeed.fjserv.net!opentransit.net!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!WebXReferences:
<1de70063.-1@WebX.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,3bc2053af32b20a2 X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2002-12-16 13:08:39 PST From: "Rich Carroll" <carrollr@cappsdigital.com> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-09!supernews.com!64.152.100.70.MISMATCH!sjc70.webusenet.com!c03.atl99!news.webusenet.com!newsfeed.icl.net!newsfeed.fjserv.net!opentransit.net!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.scripting.indesign Subject: Re: Changing text kerning Message-ID: <1de70063.2@WebX.la2eafNXanI> Date: Mon, 16 Dec 2002 13:02:06 -0800 References: <1de70063.-1@WebX.la2eafNXanI> Lines: 34 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit