How can I tell if my phone is unlocked with Smart Lock? Because then my script should behave differently.
According to macrodroid detection it is also locked with smart lock. Thus this does not help.
I also tried to detect the text. But so far I had no success: