Как-то так через Apple Script, например:
…
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(«English»)
changeKeyboardLayout(«German»)
…
Взято отсюда :
http://superuser.com/questions/224161/switch-to-specific-input-source