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 > Applescript & User Input for Chat

Applescript & User Input for Chat
Thread Tools
Forum Regular
Join Date: Mar 2001
Status: Offline
Reply With Quote
Dec 14, 2008, 06:30 PM
 
Hi all - I am trying to develop a basic script to use in Colloquy on IRC. What I'd like to do is have a boilerplate text that doesn't change, but would allow me to add to the entire message before it's sent to the channel.

This is where I'm at now:

tell application "Colloquy"
tell active panel of front window
send message "Exit all ES @ "
end tell
end tell

What I'm trying to do is allow that boilerplate text to be the start of a message being sent to an IRC channel, but allow me to add some more info and hit return before it gets sent to the channel.

Right now, if I run the script, it sends "Exit all ES @ " to the channel.

What I'd like to be able to do is have it print the "Exit all ES @ " in my Colloquy chatbox, but then let me add "XXX.XX" and then post the whole thing upon my hitting return....so that what gets to the IRC channel is:

"Exit all ES @ 901.25" or "Exit all ES @ 112.50" instead of just "Exit all ES @ " as the current script reads.

Any ideas or help? I've trawled Google and Apple but don't see anything that might lead me to this. Thanks in advance!

(By way of background, I'm trying to automate the posting of some stock market trading stuff I'm experimenting with in an IRC chatroom. It'd be much easier to script the automatic boilerplate than keep typing stuff.)


Thanks again!
     
Junior Member
Join Date: Mar 2000
Location: Salem, OR, USA
Status: Offline
Reply With Quote
Dec 21, 2008, 01:21 AM
 
So, as you have noticed you can send a message, but you can't set the text of the text field. You will have to abandon the applescript dictionary for the application and go to UI scripting for your solution.

Try this:
Code:
activate application "Colloquy" tell application "System Events" tell process "Colloquy" set value of text area 1 of scroll area 2 of splitter group 1 of splitter group 1 of window "xyz (irc.efnet.net)" to "Exit all ES @ " end tell end tell
Change the string for the window name to what is appropriate for you.

You will need to have check the "Enable access for assistive devices" check box in the Universal Access System Pref.

--numero
     
Mac Elite
Join Date: Oct 1999
Location: Montréal, Québec (Canada)
Status: Offline
Reply With Quote
Dec 23, 2008, 04:34 AM
 
I don't know the specific software he's using, but couldn't he just use a standard "display dialog" and append the entered text (text returned) to the already specified string?
     
   
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 07:51 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