Check what automations/scripts are running

This template is exactly what I need but I get a message “UndefinedError: homeassistant.util.read_only_dict.ReadOnlyDict object “ has no attribute ‘current’. I get this even when I know I have a running automation.