I don’t think this is currently possible but correct me if I’m wrong.
I would like to be able to attach a script to a tag, so I could command-click or right-click etc. on a tag and have it run a script with an optional argument (e.g. the tag value or encompassing line of text).
Presumably this could be implemented through a tag property in the style sheet?