Ticket #673 (assigned defect)

Opened 2 years ago

Last modified 9 months ago

process incoming chat message (!commands) not working anymore

Reported by: granger.laurent@gmail.com Assigned to: timothy (accepted)
Priority: high Component: AppleScript Support
Version: Latest Nightly 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

06/07/06 11:38:24 changed by timothy

  • status changed from new to assigned.

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

06/10/06 03:10:44 changed by Mickey

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

It was working in Version 2.1 (2D41).

06/10/06 04:57:48 changed by granger.laurent@gmail.com

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.

07/01/06 21:27:52 changed by akempgen

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

11/13/06 09:46:54 changed 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!

04/09/07 12:12:11 changed 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?

03/03/08 14:48:07 changed 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