Is it possible to trigger actions when I open a new tab in apps like finder?

I have AppleScript to close duplicate tabs in Finder, and while I could assign a hotkey to it, it would be good if it automatically triggered every time I opened a new tab in Finder, either with the + button or CMD T to open a new tab.

For cmd+t you can override the shortcut like this:

Clicks are more complicated (can be done using advanced trigger conditions, but I wouldn't recommend to).

I knew I could do that, I was wondering if BTT had a trigger like that since it has one for the traffic lights. Should I make a feature request for this?

You can do that if necessary:

Use this condition:

hovered_element_details CONTAINS "  <AXTabGroup: \"tab bar\">
   <AXButton: \"\">"