An AppleScript utility to fix the M4 Mac mini local network bug that prevents apps from accessing the local network after a reboot. This script automatically toggles local network permissions off and back on for all enabled apps.
M4 Mac minis have a bug where apps lose their local network access after a reboot, even though the permissions remain enabled in System Settings. A known workaround is to manually toggle the local network permission for each affected app off and back on.
This AppleScript automates the tedious process of toggling local network permissions for all apps. It opens System Settings, navigates to Privacy & Security > Local Network, and toggles the permission for each enabled app.
- Download the
.zipfile from the latest release - Extract the
Toggle Local Network.appfrom the zip file - Move it to your Applications folder (optional)
- Run the app
- Grant Accessibility permissions when prompted (it will show as "Toggle Local Network")
- Run the app again
- Click "Allow" on the popup to let it control System Settings
- Open
toggle_local_network.applescriptin Script Editor - Export as an Application:
- File > Export
- File Format: Application
- Save as:
Toggle Local Network
- Run the newly created app
- Grant Accessibility permissions when prompted (it will show as "applet")
- Run the app again
- Click "Allow" on the popup
If you build from source, the app will show up as "applet" in the Accessibility permissions list. To give it a more descriptive name:
- Build the app following Option 2
- Right-click the app and select "Show Package Contents"
- Navigate to
Contents/MacOS/ - Rename the
appletexecutable to something descriptive (e.g.,Toggle Local Network) - Open
Contents/Info.plistin a text editor - Change the
CFBundleExecutablevalue to match your new executable name:<key>CFBundleExecutable</key> <string>Toggle Local Network</string>
- Re-sign the app:
codesign --force --deep --sign - "/path/to/Toggle Local Network.app" - Now when you grant Accessibility permissions, it will show up with your chosen name
Simply run the app whenever you need to reset local network permissions (e.g., after a reboot). The script will:
- Open System Settings
- Navigate to Privacy & Security > Local Network
- Toggle all enabled app permissions off and back on
- Close System Settings
The process takes about 2-3 seconds per app.
To have the app run automatically after each reboot (when the network bug would occur):
- Open System Settings > General > Login Items
- Click the "+" button under "Open at Login"
- Select the
Toggle Local Network.app - The app will now run automatically when you log in
- macOS Sequoia (tested specifically for this version)
- Accessibility permissions for the app
Note: This script uses UI element positions (group and button numbers) rather than element names, so it's specifically designed for macOS Sequoia's System Settings layout. It may not work on other macOS versions, but feel free to give it a try.
The script uses AppleScript and UI automation to:
- Open System Settings to the Privacy & Security pane
- Navigate to the Local Network section
- Find all checkboxes that are currently enabled (value 1)
- Click each one twice (off then on) with a brief delay between clicks
- Close System Settings
- The app needs Accessibility permissions to control System Settings
- You only need to grant permissions once
- The pre-built release already has the descriptive name configured