PDA

View Full Version : AppleScript iChat Message Text Selection Problem


jag137
05-28-2009, 03:04 PM
Hi everyone,

I'm new to the forums, what a great resource!

I'm trying to complete this project for work, am nearing the deadline and cannot figure out what the issue is. The project is as follows: we have a "tech support" iChat account that, upon receipt of a message from an office member, will forward that office member's message on to the four tech support office members personal iChat accounts. I am having trouble selecting the text from the message of the standard office user and copying it into the message to be forwarded to the techies.

Here's what I've got so far:

activate application "iChat"
tell application "System Events"
tell process "iChat"
count windows
set techrequest to value of text area of scroll area of window 1
tell application "iChat"
if status of buddy "xx@xx" of service "Jabber" is available then
display dialog "Request sent to xx."
send techrequest to buddy "xx@xx" of service "Jabber"
end if
end tell
end tell
end tell

The display dialog appears correctly, but then I receive an error message of "iChat got an error: Can't make {} into type text, file, constant."


Any and all help as soon as possible will be greatly appreciated!

hayne
05-28-2009, 07:39 PM
1) Why is your "tell application iChat" nested inside your "tell process iChat" ?
Not that this causes the problem, but it seems strange.

2) Try adding a line:
display dialog techrequest
right after the "set techrequest ..." line.
Maybe what it shows will make the problem clearer.