Opened 14 years ago

Last modified 5 years ago

#673 assigned Defect

process incoming chat message (!commands) not working anymore

Reported by: granger.laurent@… Owned by: timothy
Component: Colloquy (Mac) Version: 2.2 (Mac)
Severity: Critical Keywords: remote process incoming chat message
Cc:

Description

Since last update (that should be r3263) my "remote" applescripts don't work anymore.

Very simple script example :

on process incoming chat message m
		try
			if body of m starts with "!mens" then
				set reponse to "<font color=\"lime\">..</font> <font color=\"grey\">[taille]</font> <font color=\"lime\">1,88 mètre .. </font><font color=\"grey\">[Poids]</font><font color=\"lime\"> 79 kg .. </font><font color=\"grey\">[zizi]</font> <font color=\"lime\">dlb à lmas ..</font>"
				tell panel "#freelooser" to send message reponse with action tense
			end if
                end try
end process incoming chat message

please don't ask for the meaning of such a stupid remote :p

Change History (8)

comment:1 Changed 14 years ago by timothy

  • Status changed from new to assigned

Interesting, not sure what broke. Have you used this with earlier beta versions?

comment:2 Changed 14 years ago by Mickey

Same here, the Away Nickname script for instance does not work anymore...

It was working in Version 2.1 (2D41).

comment:3 Changed 14 years ago by granger.laurent@…

yes I think I used it for 6 or 7 months but I m not sure the very
last update is guilty. I could have missed a couple of updates.

comment:4 Changed 13 years ago by akempgen

  • Summary changed from Remote AppleScripts not working anymore to process incoming chat message (!commands) not working anymore

comment:5 Changed 13 years ago by Brennan

  • Severity changed from major to critical

Confirmed here.

This is a VERY serious showstopper bug for anyone developing plugins with AppleScript?. I've upped the severity to 'critical'.

Please shuffle it closer to the front of the queue, thanks!

comment:6 Changed 13 years ago by dlx

  • priority changed from normal to high

yes, please fix that ;< i think the "body of message" function is broken. you can check for nick and stuff just fine, but doing a simple "set m to body of the_msg" will break. i'm in need of a function like that. any workaround?

comment:7 Changed 12 years ago by Brennan

Try using ((html of message) as string)

using terms from application "Colloquy"
	
	on process incoming chat message whatMessage from whichUser in whichPanel
		set msgTxt to ((HTML of whatMessage) as string)
		display dialog msgTxt giving up after 1
		
		repeat while true
			try
				--my writeLog("as string: " & (whatMessage) as string) -- appears to be broken
				
				my writeLog("body: " & (body of whatMessage) as string) -- appears to be broken
				
				--my writeLog((id of whatMessage) as string) -- appears to be broken
				--my writeLog((sender of whatMessage) as string) -- is class 'item' and can't be coerced to string, use the 'whichUser' parameter instead
				
				my writeLog("sender: " & (name of whichUser) as string)
				
				my writeLog("timestamp: " & (timestamp of whatMessage) as string)
				my writeLog("highlighted: " & (highlighted of whatMessage) as string)
				my writeLog("action tense: " & (action tense of whatMessage) as string)
				my writeLog("HTML: " & (HTML of whatMessage) as string)
				my writeLog("ignore status: " & (ignore status of whatMessage) as string) -- is an enumeration
				my writeLog(" ")
				exit repeat
				
			on error msg number n
				my writeLog((msg) as string)
				exit repeat
			end try
			
		end repeat

		if msgTxt is "test123" then
			tell active panel of front window
				add event message "processing incoming chat message" with name "test123..."
			end tell
		end if
	end process incoming chat message
	
end using terms from

on writeLog(str)
	tell application "TextEdit"
		if not (document 1 exists) then
			make new document at end
		end if
		tell document 1
			make new paragraph at end with data (str & return)
		end tell
	end tell
	
end writeLog

comment:8 Changed 5 years ago by anonymous

Has this been fixed? I am new to applescript. I only want to set 3 variables to send to a filemaker layout…..basically I am looking to send Chat Room Name ; User Name; Message Body to fields in filemaker pro on all incoming messages. It seems that I can't set the chat information to variables so I can pass them along. I successfully had it creating records after each message was sent but I can not pull the info from the message to input into the filemaker fields……Please help

Note: See TracTickets for help on using tickets.