Bind each keyboard layout to keys combination

There is a nice possibility to bind each keyboard layout to separate keys combination and switch between them.

So you can assign, for instance, shortcut Alt-Shift-0 to "Select English", Alt-Shift-1 to "Select German", Alt-Shift-2 to "Select Arabic".

How to make this on MacOS 10.7.4?


Solution 1:

Hurray! I found a way:

  1. Add layouts in side bar
  2. create an applescript

like this:

on changeKeyboardLayout(layoutName)
tell application "System Events" to tell process "SystemUIServer"
    tell (1st menu bar item of menu bar 1 whose description is "text input") to {click, click (menu 1's menu item layoutName)}
end tell
end changeKeyboardLayout

changeKeyboardLayout("US Extended")

3.Save it in /Library/Scripts

4.Bind it to the keys combination using FastScript