I have a few questions about the BATTERY() and when it fires and the belt macro:
Change Power Notification.kmmacros (10.0 KB)
As to the questions:
- I added the SCREENSAVER action because I got an error message that the macro failed because the Display Text window could not be written which at first confused me because the Keyboard Maestro Engien cannot start until log in (at the earliest).
The scenario was i) started the MacBook ii) logged into the MacBook (which started the Keyboard Maestro Engine) and ii) plugged in the external docking stations.
The theory is that the the Keyboard Maestro Engine fired off the Display Text on connecting the docking station (because it power the MacBook too) and that the displays had yet to sync up and become visible.
Is the above theory correct, is the SCREENSAVER the solution, is there a better way of doing this?
[NOTE: I cannot test at present as I am not in the office where I use teh docking station, else I would. I am trying to set the solution in advance.]
- When does the BATTERY() function fire:
a) If I start my computer → connect the external monitor or docking station → login, I do not a message that the MacBook has been plugged into a power source.
b) If I start my computer → log in → connect the external monitor or docking station, I do not get a message that the MacBook is on battery power but I do get a message that the MacBook has bene plugged in.
This leads me to believe that the power source is detected / set before login so that when I log in and the Keyboard Maestro Engine starts up, the power source is known (i.e., BATTERY() does not detect a change), and that the macro only fires when it subsequently changes (which explains the observed behaviour).
Is my understanding correct and, if not, what is the correct understanding.
