Confusion about "Screen Brightness"-Shortcut

I tried to make a Shortcuts-script to adjust my screen brightness.
If my brightness is lower than 15%, I want my screen to be adjusted to 15%.
If not (so 15% or higher), I don’t want anything to happen.

If I run my script at full brightness (or to be honest, any other % of brightness), it ALWAYS switches to 15% which is both confusing and annoying.

Who can help me?

If you are using Get Details of a device action to get the current state of your brightness is at, the number it gives you is a decimal between 0 and 1. So it will always be less than 15. Multiply the brightness by 100 and format the number not to have any decimal places. That will give you the correct number to compare to 15 in your if statement.

A good way to debug your Shortcuts is to temporarily use Quick Look actions where data is passed from one action to another. That way you can quickly see what your data looks like after each point in your program.

1 Like

Ahhh! That clears up a lot! I wasn’t aware of how Get Details exactly worked. Thanks!