• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
System Events "keystroke" not handling Belgian and other language keyboards (input)?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

System Events "keystroke" not handling Belgian and other language keyboards (input)?


  • Subject: System Events "keystroke" not handling Belgian and other language keyboards (input)?
  • From: Stephen Jonke <email@hidden>
  • Date: Thu, 9 Jun 2005 22:05:52 -0400

The following script works fine with US keyboard set as input:

  display dialog "Enter text:" default answer ""
  set someString to text returned of result

  tell application "TextEdit" to activate
  delay 1

  tell application "System Events"
      keystroke someString
  end tell

If you enter the alphabet, it all comes through fine.

However, if you switch to Belgian as the input keyboard, it goes very weirdly awry. Allegedly "keystroke" takes a "Unicode text" string as an argument, so you'd think this would work. But here's what you end up with in TextEdit if you enter the alphabet with the Belgian keyboard active (something I had to do with the Keyboard Viewer):

  qbcdefghijkl,noparstuvzxyw

It was correct in the display dialog entry, but ended up as that in TextEdit.

It gets a lot weirder than this though. Sometimes it seems to translate i's into q's. Other times it doesn't. At some point, after trying a bunch of other language keyboards I couldn't even get i's to come out correctly even after switching back to the English keyboard - it kept changing them to a's, and this seemed to carry over in every language keyboard I tried other than Belgian, which was changing them to q's. I had to log out and back in to get it right again with the US keyboard, at least.

Is something really crazy with non-US keyboard input and the "keystroke" command in Tiger, or am I missing something obvious?

Steve
_________________________________________________________________
Stephen Jonke                                  email@hidden

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: System Events "keystroke" not handling Belgian and other language keyboards (input)?
      • From: Stephen Jonke <email@hidden>
  • Prev by Date: Microsoft office question
  • Next by Date: Re: System Events "keystroke" not handling Belgian and other language keyboards (input)?
  • Previous by thread: Microsoft office question
  • Next by thread: Re: System Events "keystroke" not handling Belgian and other language keyboards (input)?
  • Index(es):
    • Date
    • Thread