Re: Tex-Edit, colorize HTML text?
Re: Tex-Edit, colorize HTML text?
- Subject: Re: Tex-Edit, colorize HTML text?
- From: "Marc K. Myers" <email@hidden>
- Date: Fri, 31 Aug 2001 19:53:24 -0400
- Organization: [very little]
>
Date: Sat, 01 Sep 2001 01:59:40 +1000
>
Subject: Re: Tex-Edit, colorize HTML text?
>
From: Timothy Bates <email@hidden>
>
To: Rachel <email@hidden>, AppleScriptUsers List
>
<email@hidden>
>
>
On 9/1/01 12:04 AM, "Rachel" <email@hidden> wrote:
>
>
> It seems like I have wasted 2 days trying to figure this out.
>
> I want to change every occurrence of a certain font in an HTML text to a
>
> color.
>
tell application "Tex-Edit Plus"
>
tell front window
>
repeat with n from 1 to count of style runs
>
if font of style run n is "Times" then
>
set color of style run n to red
>
end if
>
end repeat
>
end tell
>
end tell
>
>
> In fact, I wish I had a very flexible way to format HTML text.
>
there is an example script that comes with tex-edit to do this
Here's a way to do it without the loop. It's a bit faster:
tell application "Tex-Edit Plus"
replace window 1 looking for "^*" looking for styles {font:"Geneve"} [optn-L]
replacing with "^*" replacing with styles {color:red}
end tell
Marc K. Myers <email@hidden>
http://AppleScriptsToGo.com
4020 W.220th St.
Fairview Park, OH 44126
(440) 331-1074
[8/31/01 7:51:44 PM]