Hi, thank you for your answers, did not manage to come back to this until now.
My biggest issue is that i don't have the Macros organzed as groups per app, but like this:
Macro Toggle Favorites
If Finder (at Front) → toggle Tag "Favourite"
If Mail → Toggle Flag
If Photos → Toggle Star
The "Trigger Macro by Name" lists the Macros that are active for the current app because it searches the Text (and e.g. "Finder" is found as text in the Toggle Favorites action).
If you're referring to the native KM action, Trigger Macro by Name, then it lists the macros that are currently available based on their group settings, not by searching for text contained within the macros.
As far as I'm aware, there's no way to get a list of the currently available macros, via AppleScript or otherwise.
You are searching for "Safari" in a list of all available macros. That macro appears in the list because it is available. Available macros are those available for the current app and globally available (i.e. not app-specific) macros.