Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way that, when you switch language inputs for your keyboard, the onscreen keyboard will automatically show up?

share|improve this question
When an answer is useful, please 'accept' it. – CousinCocaine Jun 20 '14 at 9:03

I asume you want to show an onscreen keyboard when changing your keyboard layout. One obvious approach is to use AppleScript, and that is what I've done here. I think this approach is not error prone, but it works.

At first, in the Systems preferences select the keyboards you want to use, and make sure you tick 'Show Input in menu bar' System Preferences -> Keyboard -> Input Sources

Then check if your languages are available in the 'Input menu' in the top right corner of your menu-bar.

Keyboard input source name

So, now the keyboards are available from the menubar. We can use applescript to invoke with the menubar and start your onscreen keyboard.

(* A function to change the language and activate the keyboard app *)
on changeKeyboardLayout(layoutName)
    (* Close the current language keyboard app *)
    tell application "KeyboardViewer"
    end tell
    (* Change the keyboard layout *)
    tell application "System Events" to tell process "SystemUIServer"
        tell (menu bar item 1 of menu bar 1 where description is "text input")
            click menu item layoutName of menu 1
        end tell
    end tell
    (* Open the new language keyboard app *)
    tell application "KeyboardViewer"
    end tell
end changeKeyboardLayout

(* Call the function with the keyboard name as variable *)
changeKeyboardLayout("U.S. Extended")
(* changeKeyboardLayout("Canadian English") *)
(* changeKeyboardLayout("U.S.") *)

You can use Automator to make an Application or a Service of this AppleScript and and even attach a keystroke to it.

share|improve this answer
I am not an AppleScript guru, please improve when possible. – CousinCocaine Sep 9 '13 at 9:17

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.