Is it just me or are the example scripts for AIM horrible? Especially the handle chat text/im scripts. Here is one of the handlers:
on listToString(theList)
set theStr to ""
repeat with x in theList
if theStr is "" then
set theStr to (x as text)
else
set theStr to (theStr & (x as text))
end if
end repeat
return theStr
end listToString
Anyone notice that this long handler is the equivalent to "get thestring as string" ?
Also, if you look at the script from start to finish.. you'll notice that it just puts things through a bunch of useless handlers. Most of the handlers do one line and don't return any info.. and are only used once.. so what the **** is the point of the handler?
I tried condensing the recieve IM script to this:
on receiveIM(source, thestring)
display dialog "I heard \"" & thestring & "\" from " & source & "." buttons "OK" default button 1
end receiveIM
--the below is AIM's internal handler for receiving instant messages, my receiveIM() handler is basically the same except cleaner, while you can call on the below handler, I suggest using my receiveIM() handler.. I said handler a lot..
on «event OscrNuIM» theIM
my receiveIM(item 1 of theIM, item 10 of theIM)
end «event OscrNuIM»
I put it into the Scripts folder and launched AIM with no luck... exactly how am I supposed to load the script? Is my script faulty? Any help is appreciated.