Change system input/keyboard language


This is not a duplicate of because it’s a different question. It doesn’t look like anyone knows how to run an action on a fast-user switch despite this:

This question is:

Does anyone know how to change the selected input language using Apple Script?