Article View: adobe.scripting.indesign
Article #16840Re: How to set fill tint of text?
From: Kari Puikkonen
Date: Thu, 31 Jul 2003 06:51
Date: Thu, 31 Jul 2003 06:51
49 lines
2425 bytes
2425 bytes
Christopher, Dave,
I have found that only way to work with tints is to use Ole's tint hander; this scricpt does what Christopher asks:
(notice that I changed this; fill tint:replaceTint to fill color:replaceTint)
tell application "InDesign 2.0.2"
tell document 1
set findText to "�"
set replacePosition to superscript
set replaceTint to my myFindTint(document 1, "Black", 20)
set replaceFont to font "Copperplate Gothic Bold"
set replaceFontStyle to "Regular"
search for findText with change attributes {position:replacePosition, fill color:replaceTint, applied font:replaceFont, font style:replaceFontStyle}
end tell
end tell
on myFindTint(myDocument, myColorName, myTintValue)
tell application "InDesign 2.0.2"
tell myDocument
try
--Find all of the tints of a given base color.
set myTints to tints whose name is myColorName
--Iterate through the tints looking for a specific tint value.
repeat with myTint in myTints
if tint value of myTint is myTintValue then
--If the Tint value matches, then we've found our tint swatch.
--Use "object reference of" to get a direct reference to the tint object.
return object reference of myTint
exit repeat
end if
end repeat
--If we made it to this point, we haven't found the tint, so throw an error.
error
on error
--No existing tint with the tint value we're looking for exists, so make one.
set myTint to make tint with data {color:color myColorName}
set tint value of myTint to myTintValue
return myTint
end try
end tell
end tell
end myFindTint
Kari
Technical Details
Message-ID:
<1dea1e9a.7@WebX.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!news-out.visi.com!petbe.visi.com!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebXReferences:
<1dea1e9a.-1@WebX.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: f939a,a97d14f00f9b8fbe X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2003-07-31 00:08:24 PST From: "Kari Puikkonen" <kari.puikkonen@welho.com> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!news-out.visi.com!petbe.visi.com!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.scripting.indesign Subject: Re: How to set fill tint of text? Message-ID: <1dea1e9a.7@WebX.la2eafNXanI> Date: Wed, 30 Jul 2003 23:51:56 -0700 References: <1dea1e9a.-1@WebX.la2eafNXanI> Lines: 49 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit