There is unfortunately no concept of “viewer context” nor in fact any concept of “UI” or Views at all, available to Automations.
Related: Can scripts be automatically triggered by events? - #5 by Matt_Blais
This is a good candidate for a feature request - something similar to args.currentUser
- maybe args.currentView
and args.currentEntity
.
I would personally find it quite valuable if such a feature applied to Rules as well as Buttons, since I often use Checkboxes instead of Buttons to trigger Automations.
Currently there is the “Fibery Ghost ” fake User that gets associated with system-triggered Rules; there could be an equivalent “Ghost” or “background” View associated with a Rule’s “trigger context” when it is not triggered from a manual UI action, or there is no “entity context”.