I frequently look up internet dictionaries, and it would be great if the keyboard layout changes to a specific language for a dictionary automatically. For instance, when I open or activates an Korean dictionary website with a hotkey, say ^F10, the keyboard switches into Korean automatically. But I'm not saying I want Alfred to recognize what language is appropriate. I'm saying I need a method to switch the keyboard layout through workflows.
I searched the web and tried applescript, but it didn't work. Is there any script language which I can handle the keyboard layout? If so, would you recommend some useful resources?