• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: ichat on message received handler
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ichat on message received handler


  • Subject: Re: ichat on message received handler
  • From: email@hidden
  • Date: Mon, 02 Apr 2012 12:19:12 +0000
  • Importance: Normal
  • Sensitivity: Normal

I have something. Will send soon.

Sent from my Verizon Wireless BlackBerry

-----Original Message-----
From: Yuma Antoine Decaux <email@hidden>
Sender: applescript-users-bounces+zavpublic=email@hiddente: Mon, 02 Apr 2012 20:20:39
To: AppleScript Users<email@hidden>
Subject: ichat on message received handler


Hi all,

I've been working on this for a while, writing code then erasing it all and writing again, checking the net for other examples, but can't get around it, or maybe i'm not sure how exactly on handlers work yet.

I've tried the handler example on a script which monitors my ichat and upon reception of a message, takes the content of the message, compares it with a list i have, then plots a chart and sends back to the sender.

I've figured out everything for plotting the chart with smilelab's graph maker, as well as a workaround for dragging and dropping generated image into the ichat window and sending it with a keycode 36 ui command.

However, i'm still stuck at the ichat "message received" handler.

Here's what i wrote:

Set thebuddy to buddy id "blahblah"
Set curpair to {"eu", "gu", "au", "nu"}
Set posvalue to ()
Set errmsg to {"syntax error, unrecognized currency pair", "unknown pair, please try eu, gu, au or nu"}
On message received from thebuddy For ichat
Set thetext to message received
Repeat with i from 1 to count of curpair
If thetext is item i of curpair
--Tell block for plotting graph (didn't include it here)--
--tell block for sending created image in ichat back to sender (didn't include either)--
Copy "true" to end of posvalue
Else
Copy "false" to end of posvalue
End if
End repeat
If every item of posvalue is "false"
Tell application "ichat"
Send an item of errmsg to thebuddy
End if
End tell
End message received

This has several problems, mainly that buddy id works for sending, but not for using as a variable, but that's just a restriction i have for 1 buddy.

However, is the syntax for the on handler correct?

Any help greatly appreciated

Thanks, and best regards

Yuma
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >ichat on message received handler (From: Yuma Antoine Decaux <email@hidden>)

  • Prev by Date: ichat on message received handler
  • Next by Date: InDesign CS5.1 object styles
  • Previous by thread: ichat on message received handler
  • Next by thread: InDesign CS5.1 object styles
  • Index(es):
    • Date
    • Thread