Please help me on inputting Unicode text into FreeHand MX correctly. I have written the following handle:
on setValue(theValue)
try
-- bring the target application to the front & update
tell application "FreeHand MX"
activate
Update
end tell
tell application "System Events"
tell process "FreeHand MX"
tell window "Text Editor"
keystroke "E" using {command down, shift down}
keystroke "A" using {command down}
-- erase original contents
key code 51
keystroke theValue as Unicode text
key code 76
end tell
end tell
end tell
return true
on error error_message
return false
end try
end setValue
However, it does not work with any Chinese or Japanese. I verified theValue is correctly encoded in UTF-16 as in display dialog shown correclty. Could someone help me?
Thanks a ton!
P.S.
I am running in Mac OS X 10.3.4 with Script Editor 2.0 (v43).