Mounting External Drive

I created a macro to mount a drive when my home wifi is connected.The macro consists of one action-when connected to a wireless network execute automator workflow.The workflow itself works,when hit "try "the macro works,but when the computer starts the macro will not start .I tried with trigger “this wireless network with” : exact name,name containing,any wireless network etc but no success.I even included pause until conditions are met even i don’t think it is necessary as the macro should run when the network is connected.
Any suggestions?

Not sure, but I think the problem is that the WLAN trigger is triggered by the connection event, it is not checking against a connection = true condition. But when the WLAN gets connected at system start the KM engine probably is not yet running, so it doesn’t see the event.

What I would do is a second macro like this for the reboot situation:

This works for me. The If Then makes sure that the login was a login after a Mac restart, and not any login. (SECONDS() are the seconds since the last reboot.)

Alternatively, instead of the login trigger, you can try it with a At engine launch trigger.

1 Like

Thank you Tom.It works.If I use “At engine launch” and I am on a hotspot or other network the macro should crash,shouldn’t it?Sorry for the question but I am new to Keyboard Maestro.

If you’re on a hotspot the name of the WLAN will probably not match the specified WLAN name, so nothing should happen. In case that the WLAN name is the same, I don’t think that it will crash either. The worst thing that should happen is that the Automator workflow fails because it can’t find the volume to mount.

Thank you Tom.And one last thing - I replaced execute a macro with a direct execution of automator workflow.It works for now.Will I be surprised later?

No, my macro was just an example. I had overlooked that you wanted to launch an Automator macro, not a KM macro.

Thanks again.Have a nice day.

Hello Tom.Sorry to bother you again.The macro worked just fine for almost two days,and now suddenly it stopped.Same connection,same conditions and I can’t start it even manually,from the status menu.The workflow is working,checked.What could be the reason?

I don’t know. Do other macros launch? Have you tried to quit and restart the KM engine? (You can do this from the KM Editor’s File menu.)

Other macros work.Engine restarted several times.Very strange.My router is dual band maybe I should try with 2.4 Ghz network.

Ah, if the router appends “2.4GHz” or “5GHz” to the network name you should change the condition to “containing”, instead of “exact”: