Question of Combo Boxes

I am trying to add a Buddy in iChat. Unfortunately, new Buddy’s can not be made using Applescript. For that reason, I am dropping back to GUI scripting.

Currently, i have the Add Buddy Dialog open. It is using combo boxes for the Account Name, First and Last Name. They are not combo boxes in what I think the true since of the combo box is, with a menu and choices below it. I believe they are a combo box because the values can be typed in or retrieved from the AddressBook.

I want to programmatically set the values of the three combo boxes. I could use a series of keystroke’s to fill the fields, but if I can, I would like to manipulate the combo boxes directly.


tell application "iChat" to activate
tell application "System Events"
	tell process "iChat"
		set myComboBox to combo box 1 of sheet 1 of front window
		tell myComboBox to setStringValue_("Test")
	end tell
end tell


tell application "iChat" to activate
tell application "System Events"
	tell process "iChat"
		set myComboBox to combo box 1 of sheet 1 of front window
		myComboBox's setStringValue_("Test")
	end tell
end tell

They both generate similar errors- “System Events got an error: myComboBox of «script» doesn’t understand the setStringValue_ message.”

A also tried to get the TextField of the ComboBox manipulate that directly and got similar results.

Please help steer me straight.

Thanks.

Hi,

why not the vanilla AppleScript way?


tell application "iChat" to activate
tell application "System Events"
	tell process "iChat"
		set myComboBox to combo box 1 of sheet 1 of front window
		set value of myComboBox to "Test"
	end tell
end tell

Looks like I overlooked the obvious, again. Well, at least I succeeded making things harder that they needed to be, again. Thanks for setting me straight, Stefan.