Article View: adobe.scripting.indesign
Article #20321Re: [AS] Coloring a single Character
From: Peter Boctor
Date: Thu, 18 Jul 2002 19:51
Date: Thu, 18 Jul 2002 19:51
17 lines
1748 bytes
1748 bytes
Hi Rick,
#1. The "fill color" property only takes an object reference to a color. If you are inside of a tell text frame block, then the only way to get a color object reference is if it was previously set in a variable. If you are in a tell document block then it works correctly:
tell application "InDesign 2.0.1"
tell document 1
set the fill color of (every character of text frame 1 where the contents of it is "y") to swatch "Red"
end tell
end tell
I talked about this a little in this topic yesterday: Peter Boctor "[AS] Applied paragraph style ??" 7/18/02 7:04am </cgi-bin/webx?13@@.ef9b7a9/1>
Having said that, we've had a long standing feature request to allow properties that currently require an object reference to accept just a string as well.
#2. That is an interesting point. I don't see why you shouldn't be able to use "text" instead of "contents". It doesn't work right now, so let me try and figure out what is going on.
-peter
Technical Details
Message-ID:
<ef9b49f.2@WebX.aaQKaf7vad4>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!sn-xit-04!supernews.com!iad-peer.news.verio.net!news.verio.net!news.maxwell.syr.edu!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!WebXReferences:
<ef9b49f.-1@WebX.aaQKaf7vad4>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,ef424db366e651a8 X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2002-07-18 13:16:58 PST From: "Peter Boctor" <peter.boctor@adobe.com> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!sn-xit-04!supernews.com!iad-peer.news.verio.net!news.verio.net!news.maxwell.syr.edu!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.scripting.indesign Subject: Re: [AS] Coloring a single Character Message-ID: <ef9b49f.2@WebX.aaQKaf7vad4> Date: Thu, 18 Jul 2002 12:51:09 -0700 References: <ef9b49f.-1@WebX.aaQKaf7vad4> Lines: 25 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit