🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #19509

Changing text kerning

#19509
From: Rich Carroll
Date: Fri, 13 Dec 2002 22:29
26 lines
2070 bytes
Hello brillant collective mind,
I am attempting to create an InDesign version of Quarks extension called "Kerning Palette" using Applescipt. Basically the script gets the kerning value of the current insertion point, selects the pair of characters wrapped around the insertion point, and applys the new kerning value to any other instances of the character pairs. The problem I have is that the replacing is deleting all the text.

Here's what I have so far

tell application "InDesign 2.0.2"
	set myProps to properties of selection
	set kerningValue to kerning value of myProps as string
	set objRef to object reference of myProps
	set parentProps to parent of myProps
	set objRef2 to index of objRef
	select (characters (objRef2 - 1) thru objRef2) of parentProps
	set charPair to properties of selection
	set charContents to contents of charPair
	set charFontStyle to font style of charPair
	set charPair to charPair as list
	set myResults to {}
	set CharFontSize to item 87 of charPair
	set charFont to item 19 of charPair
	set find preferences to nothing
	set change preferences to nothing
	search document for {text contents:charContents} with find attributes {font:charFont, size:CharFontSize, font style:charFontStyle} �
		replacing with charContents with change attributes {kerning value:kerningValue}
end tell

Any ideas?
Technical Details
Message-ID: <1de70063.-1@WebX.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!news.stealth.net!news.stealth.net!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: f939a,3bc2053af32b20a2,start
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2002-12-13 14:37:47 PST
From: "Rich Carroll" <carrollr@cappsdigital.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!news.stealth.net!news.stealth.net!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX
Newsgroups: adobe.scripting.indesign
Subject: Changing text kerning
Message-ID: <1de70063.-1@WebX.la2eafNXanI>
Date: Fri, 13 Dec 2002 14:29:46 -0800
Lines: 33
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit