Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Draft

macrumors 6502
Original poster
Jun 18, 2002
455
1
Chicago, IL
I am trying to write an AppleScript for Colloquy that presents a new context menu item when right-clicking on a member of a room, then when selecting the menu item does some action using the user name from which the context menu was built and accessed. I've checked the examples on the Colloquy site, but none of them explicitly do what I need to do and I'm not familiar with how AppleScript works in order to get the information out of objects that I need in order to move forward.

What I currently have is below and includes comments on how I believe this should be accomplished. Any ideas on how to do this? Thanks in advance.

Code:
using terms from application "Colloquy"
	on build contextual menu for item theMenuItem in theView
		(*wrap return statement with an if statement that determines if this is a member of a room, rather then a window, room, etc.*)
		return {"Who is this?"}
	end build contextual menu for item

	on handle clicked contextual menu item theMenuItem for theContextItem
		if (theMenuItem as string) is equal to "Who is this?" then
			set theUser to "blah" (*replace with conversion of theContextItem to string with the member name*)
			tell active panel of front window
				add event message (theUser as string) with name "member user name"
			end tell
		end if
	end handle clicked contextual menu item
end using terms from
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.