Re: Tex-Edit: What OSAX is this using?
Re: Tex-Edit: What OSAX is this using?
- Subject: Re: Tex-Edit: What OSAX is this using?
- From: JJ <email@hidden>
- Date: Thu, 21 Nov 2002 17:10:18 +0200
>
on 21 November 2002 4:57 am, I wrote:
>
>
> on Tue, 19 Nov 2002 07:46:03 -0700, Gnarlodious <email@hidden>
>
> wrote:
>
>
>
>> This ran well in 9.2, but not in X. The problem line is:
>
>> set color of style run n to "#FF33DD"
>
>> So I need to know:
>
>> 1) Does this script run vanilla in 9.2? I tried it in 9 and no go.
>
>
>
> I don't believe this is a vanilla coercion on any system, Rachel.
>
>
For a reasonably fast vanilla handler, Rachel, try replacing "#FF33DD" with:
>
>
my hexToRGB("#FF33DD")
>
>
...then add something like this subroutine to your script:
>
>
------------------------------------------------
>
on hexToRGB(tx)
>
set {tid, tx, hx, rgb} to [NO BREAK]
>
{text item delimiters, tx's text -6 thru -1, "0123456789ABCDEF", {}}
>
repeat with n from 1 to 6 by 2
>
set text item delimiters to tx's character n
>
set {hi, text item delimiters} to [NO BREAK]
>
{(hx's text item 1's length) * 4112, tx's character (n + 1)}
>
set {lo, text item delimiters} to [NO BREAK]
>
{(hx's text item 1's length) * 257, tid}
>
set rgb's end to hi + lo
>
end repeat
>
rgb
>
end hexToRGB
>
------------------------------------------------
>
>
Not tested exhaustively - but seems to work on the examples I've tried so
>
far...
>
>
HTH
>
>
Kai
Cool!! And very quick!
;-)
JJ
Yahoo! Mail Plus Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.