Are you on Monterey? A quick test with KM on macOS 12 shows this condition always evaluating to "True" -- even when the test string is "Ooops!" -- but the same action performs as expected in High Sierra.
It might be relevant that Apple made some changes to the airport
utility in macOS 12 -- in particular it doesn't return BSSID or Country unless run with sudo
. (@peternlewis -- don't know if you can do anything about this on the KM side?)
We can use the airport
utility to create a workaround, but because it now needs sudo
you'll have to do some setup first and add it to your sudoers file so you don't have to authenticate.
In Terminal, type sudo visudo /private/etc/sudoers.d/airport
and authenticate, to create (or edit if it already exists) a sudoers file containing your airport
utility exceptions.
Hit the I
key to enter "Insert mode" and type in:
username ALL=NOPASSWD: /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I
...replacing username
with your account's short username. Hit the ESC
key and then type :wq
to save and exit.
Open another Terminal window and check this works by typing
sudo /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I
...and you should get a bunch of Wi-Fi info, without being asked for your password. If you are on your work network, this is a good time to grab the BSSID!
You can now use this example macro:
BSSID test.kmmacros (3.3 KB)
...and test things are working. As implied by the "contains" field, airport
returns an "abbreviated" MAC address which omits any leading 0
of a pair -- you might be more used to seeing the example address of aa:aa:aa:b:c:d
as aa:aa:aa:0b:0c:0d
-- so watch out for that.
You may have to test against a list of BSSIDs -- they uniquely identify access points, so you'll need one entry for every AP at work (apologies if I'm stating things you already know...).
This is all theoretical, not something I've used myself beyond a quick test while writing it -- I'd love to hear how you get on!