Re: Tex-Edit X: Web snapping colors
Re: Tex-Edit X: Web snapping colors
- Subject: Re: Tex-Edit X: Web snapping colors
- From: Gnarlodious <email@hidden>
- Date: Fri, 22 Nov 2002 09:21:51 -0700
Muchas gracias to JJ, has and specially Kai for helping hammer this out.
Just what I wanted for my colorcoded Stylesheets!
--Hex triplet alfa must be Ucase
tell application "Tex-Edit"
tell front window
replace looking for "^*" replacing with "^*" replacing with styles
{color:my hexToRGB("#CC22AA")}
end tell
end tell
on hexToRGB(tx)
set {tid, tx, hx, rgb} to {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 {(hx's text item 1's length) *
4112, tx's character (n + 1)}
set {lo, text item delimiters} to {(hx's text item 1's length) *
257, tid}
set rgb's end to hi + lo
end repeat
return rgb
end hexToRGB
_______________________________________________
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.