# \[Tip\] Fast User Switching on macOS Sonoma/Sequoia using AppleScript (The "Tab-Space" Method)

**URL:** <https://community.folivora.ai/t/tip-fast-user-switching-on-macos-sonoma-sequoia-using-applescript-the-tab-space-method/47015>\
**Category:** Tutorials\
**Tags:** applescript, switch\
**Created:** [May 12, 2026, 10:07pm UTC](https://community.folivora.ai/t/tip-fast-user-switching-on-macos-sonoma-sequoia-using-applescript-the-tab-space-method/47015 "2026-05-12T22:07:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mira](https://community.folivora.ai/letter_avatar_proxy/v4/letter/m/b5ac83/32.png) [@mira](https://community.folivora.ai/u/mira)\
**Post date:** [May 12, 2026, 10:07pm UTC](https://community.folivora.ai/t/tip-fast-user-switching-on-macos-sonoma-sequoia-using-applescript-the-tab-space-method/47015/1 "2026-05-12T22:07:58Z")

</div>

Hi everyone,

Since Apple removed the `sac_switchuser` function and the old `CGSession` binary no longer works on recent macOS versions (Sonoma/Sequoia), it has become quite difficult to trigger a specific user switch via a shortcut.

I found a reliable way to do this using a UI-based AppleScript that interacts with the Control Center. This is particularly useful if you want a one-click shortcut to jump to a specific secondary account.

### **The Script**

Assign this code to a shortcut or a trackpad gesture using the **"Execute AppleScript"** action:

```auto

tell application "System Events"
tell process "ControlCenter"
-- Find the User icon in the menu bar (localized for French/English)
set userMenu to (first menu bar item of menu bar 1 whose description contains "User" or description contains "Utilisateur" or description contains "Account")
click userMenu

    -- Wait for the panel to pop up
    delay 0.5
    
    -- Focus the first user in the list
    key code 48 -- Tab key
    delay 0.2
    
    -- Move to the right to select the second user (adjust if you have more)
    key code 48 -- Tab key
    delay 0.2
    
    -- Press Space to confirm the switch (more reliable than Enter here)
    key code 49 -- Space key
end tell

end tell

```

Hope this helps anyone struggling with the "No such file or directory" errors on the old terminal commands!
