Assigning shortcuts to particular keyboard layouts Is there any way to assign hotkeys to switching to particular keyboard layouts directly, without having to cycle through them one by one?

I am quite new to OS X.  On Windows (which I used before) it is possible to set keyboard shortcuts for witching directly to particular keyboard layouts.  For example, I set it up so that Shift-Alt-1 switches directly to English, Shift-Alt-2 switches directly to Hungarian, etc.  This is very convenient when one has several layouts installed (I regularly used 4 different ones on Windows), and much faster than having to cycle through layouts one by one, especially when writing multilingual documents and needing to switch often.

Is there similar functionality in OS X?  If there's isn't by default, is there a hack or third party program to set it up?
There is a solution that has been vetted on 10.5 through 10.7 and has both a source code example as well as a link to a direct download of a program to do this sort of switching.

https://discussions.apple.com/thread/4032238

You'll need Xcode or to use the compiled program to test if this works for you. And always, use caution when downloading software from the internet. Most people are nice and good, but sometimes it's hard to know what you're running.