Need help with auto full brightness when connected, started a macro and stuck

Hi all

im aiming at creating a macro where if the laptop is plugged in and not on full brightness will execute a full brightness macro. I have this semi working using the following macro

problem is it happens every 15 seconds even if the screen brightness if full which is of course annoying. How does one restrict the whole macro to only run if the screen brightness is < 100%?

Also: very open for more simple/robust ideas/macro as my method seems kinda clunky :smiley:



What you need to do is track the last Battery condition and only perform the actions if it has changed to off. Something like:

  • Set variable Local This Battery to calculation BATTERY()
  • If Local This Battery != DND Last Battery AND !Local This Battery
    • Increase Screen Brightness
  • Set variable DND Last Battery to calculation Local This Battery

Thx @peternlewis

Im afraid I couldn’t follow your example quite fully so played around and came up with this with the help of some command line tools

but for some reason it dosent work since I think the condition that I have in the first if statement dosent work and always comes up as false no matter if the MacBook is plugged or not

I do see the actually variable changing in the variable keyboard maestro browser.

any clue guys?


after some digging found this thread:


You are using the Environment Variable condition, instead you should be using the Variable condition.

perfect thx so much

here is the macro if anyone is interested!


1 Like