Script for Finding the Best WiFi Channel
When running a wifi router in a public space, the least congested channel will offer the best performance. Use this script for Apple computers to help you find that channel fast.
For live sound events I often use wifi to interact with computers and digital devices that control audio, video, and lighting. Having dedicated, reliable wifi is critical for successful productions, so I bring my own router with me to live events. This is the model I own and recommend.
WiFi is has become nearly ubiquitous. Networks are everywhere. The increasing number of public, private, commercial, and consumer grade broadcasts mean that the designated wifi spectrum is growing more crowded. Like lanes on a highway, there are a limited number of wifi channels to choose from. Car drivers try to avoid traffic and choose the least crowded lane on the road. Likewise, you will get the best wifi experience by “driving” in the least congested wifi channel.
Apple computers have a built in Wireless Diagnostics service with a sub program that recommends the best wifi channel. It’s hidden away in the system folder and I have a hard time remembering the exact clicks and keystrokes to find it. So I wrote an AppleScript that runs inside an Automator Service to make the exact window pop up when I need it.
This is the easiest way to get it in the right place:
- Download this ZIP file: Find-Best-Wireless-Channel.workflow.zip
- Double-click the ZIP file to unzip it.
- While still in the Finder, click Go to Folder… under the Go menubar item. Alternatively, press the key combination ⇧⌘G (Shift-Command-G).
- In the little window that drops down, type the following:
~/Library/Services
- Hit the ⎠(Return) key. The Finder will navigate directly to that folder.
- Copy or move the Find-Best-Wireless-Channel.workflow file to that folder.
Once you’ve put the workflow file into that folder, look for it under Finder > Services > General.
When you click on the “Find Best Wireless Channel” service item the workflow will run and a you should be left with a window named “Scan” opened. The wireless networks that your Mac has found will be listed on the right. Look at the panel on the left.
The best wifi channels will be listed at the bottom. Use these numbers to set your router’s wifi channel. Good luck!
Notes
OS Compatibility
This Automator service works on macOS Sierra. Depending on your current OS and any future OS updates, YMMV.
No Library?
If you can’t see your Library folder, follow the directions found here to unhide your Library.
Roll Your Own
For those of you that like to DIY, here’s the raw script.
tell application "Wireless Diagnostics"
activate
# opens Scan Window
tell application "System Events" to keystroke "4" using {command down, option down}
# brings Assistant Window to the front and closes it
tell application "System Events" to keystroke "1" using {command down, option down}
tell application "System Events" to keystroke "w" using {command down}
end tell
Keystroke Combo Power-Ups!
If you want to assign a key command to this workflow service like I did, open up  > System Preferences… > Keyboard > Shortcuts. In the left panel select Services and scroll down to the bottom of the right panel. Next to “Find Best Wireless Channel” click the word “none” and then the “Add Shortcut” button that appears. Press the combination of keys you want to trigger the workflow. Voilà !
2 Comments >
filed under: VERY SPECIFIC
Haha! Yes, esoteric. BUT…if I’m one-in-a-million and there are 7.4 billion people on earth, then maybe 7,400 other people might find this useful.