keystroke is acting strange

Hi

i’m currently making a script for entourage to export your calendar to a html page. Because the calendar is hardly scriptable i had to resort to UI scripting.
Now here’s the problem when i give the command -keystroke “Wobbie”- the result in the window is “Wobbqe”… so the “i” is replaced by “q”.

How is this possible and what can i do about it?


tell application"finder"
my do_submenu(“Microsoft Entourage”, “View”, “Go To”, “Calendar”)
my do_menu(“Microsoft Entourage”, “File”, “Save as Web Page…”)

tell application "Microsoft Entourage" to activate
tell application "System Events"
	tell process "Microsoft Entourage"
		click checkbox "Open saved Web page in browser" of window "Save as Web Page"
		keystroke "	"
		keystroke "	"
		keystroke "a" using command down
		keystroke "Wobbie"
	end tell
end tell

end tell

on do_menu(app_name, menu_name, menu_item)
try
– bring the target application to the front
tell application app_name
activate
end tell
tell application “System Events”
tell process app_name
tell menu bar 1
tell menu bar item menu_name
tell menu menu_name
click menu item menu_item
end tell
end tell
end tell
end tell
end tell
return true
on error error_message
return false
end try
end do_menu

on do_submenu(app_name, menu_name, menu_item, submenu_item)
try
– bring the target application to the front
tell application app_name
activate
end tell
tell application “System Events”
tell process app_name
tell menu bar 1
tell menu bar item menu_name
tell menu menu_name
tell menu item menu_item
tell menu menu_item
click menu item submenu_item
end tell
end tell
end tell
end tell
end tell
end tell
end tell
return true
on error error_message
return false
end try
end do_submenu

What happens when you do it 1 letter a time?


keystroke "W"
keystroke "o"
keystroke "b"
keystroke "b"
keystroke "i"
keystroke "e"

same thing, the “i” is converted to q

very strange.

very strange indeed. The keystroke “i” seems to be working on my machine. Maybe something’s wrong with the application you’re using. Maybe you can use the key code for the letter i.

well, the problem seems to occur in different applications, i’ve tried Entourage, word and text edit and they all convert the “i” to “q”

think my system is pretty messed up…