Scripting and changing typeface styles

An instant messenger which can connect to AIM, GTalk, Jabber, ICQ, and more.
Post Reply
KiltOtter
Harmless
Posts: 2
Joined: Sun May 01, 2005 2:38 pm
Location: Perth, Western Australia

Scripting and changing typeface styles

Post by KiltOtter »

Question for the scripters here...

I'd like to know how to add the likes of a colour change to a letter or series of letters in a string, so that when the string is sent to the user as a message the colours are also there.

eg. if {RED} is for red colour on/off and so on, and the text Hello! is sent to the script, then the script should return {RED}Hello!{RED}.

Thanks in advance.

Kilty
User avatar
noleli
Latté
Posts: 80
Joined: Sun Dec 19, 2004 7:14 pm
Location: UMich

Post by noleli »

You have to use HTML. It needs some coercing, as HTML in IMs is, shall we say, special. I think it needs to be all caps, and include the <HTML> and </HTML> tags. So IIRC (and this is untested...):

<HTML><FONT COLOR="FF0000">String</FONT></HTML>

Maybe you're not even supposed to have the quotes. I don't remember. I suggest going into official AIM, setting an away message with color in it, and using AppleScript to return the raw source of the message. That should show you how it's done, if I've got it wrong.
User avatar
zaudragon
Growl Team
Posts: 1852
Joined: Sat Dec 04, 2004 5:05 am
Location: Kensington, CA, USA
Contact:

Post by zaudragon »

noleli wrote:You have to use HTML. It needs some coercing, as HTML in IMs is, shall we say, special. I think it needs to be all caps, and include the <HTML> and </HTML> tags. So IIRC (and this is untested...):

<HTML><FONT COLOR="FF0000">String</FONT></HTML>

Maybe you're not even supposed to have the quotes. I don't remember. I suggest going into official AIM, setting an away message with color in it, and using AppleScript to return the raw source of the message. That should show you how it's done, if I've got it wrong.
Well in my Raw HTML script ( http://trac.adiumx.com/wiki/EnteringHTML ) I just have it return what is typed in… and it displays it.

So when I use

Code: Select all

/html{<HTML><FONT COLOR="#FF0000">String</FONT></HTML>}
I get
String
back.
Blog | X(tras)
Communists code without classes.
KiltOtter
Harmless
Posts: 2
Joined: Sun May 01, 2005 2:38 pm
Location: Perth, Western Australia

Post by KiltOtter »

Thanks, have been trying, some minor issues, so will have to think how to get around them. The concept is sound, just gives some strange results.
Post Reply