Many thanks to @peternlewis for pointing me in the right direction. With his help I was able to solve my problem with a three way approach:
- Trigger the macro when the Keyboard Maestro engine lauches.
- Trigger the macro when when the Mac awakes from sleep.
- And compare the current Wireless Network Name with the name of the last Wireless Network Name which is stored in a global variable.
My slight feeling is, that 3. might be not necessary – but who knows. Without further ado here is an image from my macro, which runs now for several weeks rock solid:
