Then ensure that the service accepts "no input" and will work in "all applications," and then add a single instance of the "Run Shell Script" action to the workflow. To create a log-in window hot key, open Automator and create a new Service workflow. This can be implemented in several ways, but the following examples are quick options for setting up hot keys for the log-in window and for single user accounts: When run, this workflow will execute the specified Unix command to switch to the user "tkessler" (click for larger view). With these options, you can then use Apple's Automator utility to set up a hot-key service for switching users. System/Library/CoreServices/Menu\ Extras/nu/Contents/Resources/CGSession -switchToUserID `id -u USERNAME` System/Library/CoreServices/Menu\ Extras/nu/Contents/Resources/CGSession -suspend The command is called "CGSession" and can be used in the following ways to either bring up the log-in window or to switch to an account that is already logged in. To do this, you can take advantage of a hidden Terminal command that is part of the User menu extra and is invoked by the menu to switch users. For most people this is perfectly fine to do, but if you want to speed this up, you can create a custom hot key that will switch users for you. This feature is more convenient you can use it to quickly switch among accounts, but it does not have any hot-key options, so you will need to access it via the mouse. Apple does have a hot key (Option-Command-Q) for logging out of the current account and returning to the log-in window, but the system's Autosave and Resume features are not supported in all applications, so workflows may not be entirely preserved, and logging out will halt running applications.Īnother option is to use fast-user switching and then select an account or return to the log-in window from the User menu that appears next to the Spotlight menu. Regardless of the need, if you have multiple accounts on the system that you regularly switch among, you might find doing so a burden.
The user menu gives you quick access to multiple accounts, but requires that you access it with your mouse. Alternatively you might like to have a separate user account for testing purposes if you've been experiencing oddities with your system and are trying to troubleshoot the situation.
With this setup, not only can multiple people use a system, but an individual can also configure it to have multiple work environments.įor example, if you use your computer for two jobs and would like to keep all work for one completely separate from another, then one option is to use multiple user accounts for this. OS X is a multiuser operating system so each user can tailor the system for his or her own needs without interfering with another user's workflow.