FAQFAQ   SearchSearch   UsergroupsUsergroups   RegisterRegister   ProfileProfile    Log inLog in   RSS Feed

iChat script: Send iChat message from Clicker

 
Post new topic   Reply to topic    Salling Software Forums Forum Index -> Salling Clicker for Mac
View previous topic :: View next topic  

Did you find this post helpful?
Yes
100%
 100%  [ 1 ]
No
0%
 0%  [ 0 ]
Total Votes : 1

Author Message
cDizzle
Newbie


Joined: 02 Dec 2009
Posts: 1

PostPosted: Wed Dec 02, 2009 8:31 pm    Post subject: iChat script: Send iChat message from Clicker Reply with quote

Hey all,

I don't know if this script existed already, but I couldn't find it so here's a fresh take on how to send a message to the frontmost chat window from the Clicker app on the phone. The messages are limited to 100 characters.

I am putting the script below, if someone would like to turn it into a .cgz and host it, feel free. Just don't forget to mention it in a reply to this post.

Oh, and a big thanks to Doug Adams and his "Current Song to iChat" script off his awesome site: http://dougscripts.com/

Much Respect,

cDizzle.

<-----cut & paste the script below into AppleScript Editor----->

if my is_application_launched() then
my launch_widget()
else
tell application "SEC Helper" to enter boolean popup mode question "Launch iChat?" affirmative response "open_app_response"
end if

on open_app_response(flag)
if flag is not 0 then
tell application "iChat" to launch
my launch_widget()
end if
end open_app_response

on is_application_launched()
tell application "System Events"
return (exists process "iChat")
end tell
end is_application_launched

on launch_widget()
tell application "SEC Helper"
enter text field mode title "Send Message" prompt "Message:" length 100
end tell
end launch_widget

on affirmative_textfield_response(my_message)
tell application "iChat"
send my_message to buddy (last item of my text_to_list((get name of front window as string), "with "))
end tell
tell application "SEC Helper" to enter popup mode text ("Message Sent: " & txt)
end affirmative_textfield_response


on text_to_list(txt, delim)
set saveD to AppleScript's text item delimiters
try
set AppleScript's text item delimiters to {delim}
set theList to every text item of txt
on error errStr number errNum
set AppleScript's text item delimiters to saveD
error errStr number errNum
end try
set AppleScript's text item delimiters to saveD
return (theList)
end text_to_list
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Salling Software Forums Forum Index -> Salling Clicker for Mac All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group