I know how to change the keyboard layout in general, but I want certain applications to always open with a specific layout, not the same for all of them. For example, I'd like Firefox to open with a Spanish layout, but Mathematica with a US layout. How can I do this?

I'm using Snow Leopard

link|improve this question
See also superuser.com/questions/173494/… – mankoff Sep 16 '10 at 2:14
feedback

2 Answers

You can write an Applescript that constantly runs and checks if an app has focus and if it does then it sets the keyboard layout to one layout and when it detects that the app doesn't have focus it switches the layout back again. Have it run at login.

I can't help with writing the app, but that would be the solution.

Here are a couple of related articles that I found:

link|improve this answer
feedback

I think the easiest solution is to add a bit of manual work and do it as follows:

  • Turn on the languages you want in System Prefs > Language & Text > Input Sources
  • Under "Input source options" select the "Allow a different one for each document"
  • Set up a keyboard shortcut to change keyboard layout
  • Launch your app, change your keyboard layout, and it will only be changed for that window.
  • If you bring up a new firefox window, you'll need to re-select the language for that new window.

To answer your specific desire to have apps open in one layout:

  • Set the "Allow a different one for each document" as directed above.
  • Find out how to change the layout via script. Solutions seem available...
  • Make a new launcher (AppleScript) for Firefox that launches Firefox, then runs the keyboard changer after a delay (when you are sure Firefox is open and in front).
  • Perhaps this is good enough as doing it at launch meets your needs. If not, run it continuously as @pattern86 suggested
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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