Access Fast User Switching from a script in Big Sur

automatorscriptterminal

In macOS Mojave, I found that you could make an Automator app that allowed fast user switching by a hot key. The command run was

/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -switchToUserID `id -u XXXXXX`

With the Automator App, I could assign a hot key which would then run the command easily without any mouse interaction.

I'm now setting up a Big Sur computer and trying switch to a different user by a hot key. The script above does not work now and gives a no such file error. I'm wondering if there is another way to switch to a userid or a different command to use in order to do this?

Best Answer

User.menu along with other menu items were incorporated into Control Center in Big Sur, which removed the menu item package from Menu Extras. Gone with it is CGSession.

There does not appear to be an immediate replacement, and while workarounds for some of its other functionality have been developed, nothing for fast user switching yet.