Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Scripting AIM

Scripting AIM
Thread Tools
Mac Elite
Join Date: Oct 2000
Status: Offline
Reply With Quote
Dec 1, 2001, 10:13 PM
 
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.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 11:18 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2