1) You're not actually returning anything from the on substitute() function.
2) I have no idea what those 'set size of' commands are actually doing in terms of what return value we'd get... Adium does accept HTML, though, so while it won't look quite as elegant, perhaps the easiest way to go would be to insert <HTML> at the beginning and then do <FONT ABSZ="8">a</FONT><FONT ABSZ="9">b</FONT><FONT ABSZ="10">c</FONT> and so on.
ABSZ is the absolute size tag. It specifies a point size just like you're wanting to.
Our HTML decoder probably won't parse your div tag anyways.
Also, keep in mind that, as you probably know, current message styles don't handle changing fonts and such very well... so you may or may not see proper results within Adium even if you get it working, for now
on substitute(unwave)
set x to 0
set rsult to ""
set waved1 to ""
set waved2 to ""
set x to x + 1
set waved1 to "<FONT ABSZ=\"" & (11 + x) & "\">" & character (x) of unwave & "</FONT>"
set rsult to rsult & " " & waved1
repeat until x ? ((number of characters in unwave) / 2)
set x to x + 1
set waved1 to "<FONT ABSZ=\"" & (11 + x) & "\">" & character (x) of unwave & "</FONT>"
set rsult to rsult & waved1
end repeat
set y to x
repeat until x = ((number of characters in unwave))
set y to y - 1
set x to x + 1
set waved2 to "<FONT ABSZ=\"" & (11 + y) & "\">" & character (x) of unwave & "</FONT>"
set rsult to rsult & waved2
end repeat
set rsult to "<HTML>" & rsult & "</HTML>"
return rsult as string
end substitute
--[url=applescript://com.apple.scripteditor/?action=new&script=(*%0Adisplay%20dialog%20%22unwave%3A%22%20default%20answer%20%22aaaaaaaaaaaaaaaaaaaaaaaaaaaa%22%0Aset%20txt%20to%20text%20returned%20of%20result%0Adisplay%20dialog%20%22%22%20default%20answer%20substitute(txt)%0A*)%0Aon%20substitute(unwave)%0A%09set%20x%20to%200%0A%09set%20rsult%20to%20%22%22%0A%09set%20waved1%20to%20%22%22%0A%09set%20waved2%20to%20%22%22%0A%09set%20x%20to%20x%20+%201%0A%09set%20waved1%20to%20%22%3CFONT%20ABSZ%3D%5C%22%22%20%26%20(11%20+%20x)%20%26%20%22%5C%22%3E%22%20%26%20character%20(x)%20of%20unwave%20%26%20%22%3C%2FFONT%3E%22%0A%09set%20rsult%20to%20rsult%20%26%20%22%20%22%20%26%20waved1%0A%09repeat%20until%20x%20%B3%20((number%20of%20characters%20in%20unwave)%20%2F%202)%0A%09%09set%20x%20to%20x%20+%201%0A%09%09set%20waved1%20to%20%22%3CFONT%20ABSZ%3D%5C%22%22%20%26%20(11%20+%20x)%20%26%20%22%5C%22%3E%22%20%26%20character%20(x)%20of%20unwave%20%26%20%22%3C%2FFONT%3E%22%0A%09%09set%20rsult%20to%20rsult%20%26%20waved1%0A%09end%20repeat%0A%09set%20y%20to%20x%0A%09repeat%20until%20x%20%3D%20((number%20of%20characters%20in%20unwave))%0A%09%09set%20y%20to%20y%20-%201%0A%09%09set%20x%20to%20x%20+%201%0A%09%09set%20waved2%20to%20%22%3CFONT%20ABSZ%3D%5C%22%22%20%26%20(11%20+%20y)%20%26%20%22%5C%22%3E%22%20%26%20character%20(x)%20of%20unwave%20%26%20%22%3C%2FFONT%3E%22%0A%09%09set%20rsult%20to%20rsult%20%26%20waved2%0A%09end%20repeat%0A%09set%20rsult%20to%20%22%3CHTML%3E%22%20%26%20rsult%20%26%20%22%3C%2FHTML%3E%22%0A%09return%20rsult%20as%20string%0Aend%20substitute]Open this script in a new Script Editor window[/url].
(* display dialog "unwave:" default answer "aaaaaaaaaaaaaaaaaaaaaaaaaaaa" set txt to text returned of result display dialog "" default answer substitute(txt)
*) onsubstitute(unwave) setxto 0 setrsultto "" setwaved1to "" setwaved2to "" setxtox + 1 setwaved1to "<FONT ABSZ=\"" & (11 + x) & "\">" & character (x) ofunwave & "</FONT>" setrsulttorsult & " " & waved1 repeatuntilx is greater than or equal to ((numberofcharactersinunwave) / 2) setxtox + 1 setwaved1to "<FONT ABSZ=\"" & (11 + x) & "\">" & character (x) ofunwave & "</FONT>" setrsulttorsult & waved1 endrepeat setytox repeatuntilx = ((numberofcharactersinunwave)) setytoy - 1 setxtox + 1 setwaved2to "<FONT ABSZ=\"" & (11 + y) & "\">" & character (x) ofunwave & "</FONT>" setrsulttorsult & waved2 endrepeat setrsultto "<HTML>" & rsult & "</HTML>" returnrsultasstring endsubstitute
-------------------------
[This script was automatically tagged for color coded syntax by Convert Script to Markup Code]
- It'd be a lot easier for someone to help with an example that isn't aaaaaaaaaa but rather illustrates the problem
- Screen shots in this context, or something, might be useful
- Posting the packaged AdiumXtra would be helpful, as well.