Is there a reason this needs to work from AppleScript? Could you make a separate "Trigger Macro by Name" macro configured with "a:safari" in the macro itself?
@gglick Thanks for showing that %TriggerValue% in the Macro search field receives the passed parameter. I didn't think of the script parameter as a Trigger.
I do have specific searches already filled out like you showed, but I wanted to use AppleScript to analyze the window and document in some apps and restrict the search choices accordingly without cluttering up KM with many variations of the search Macro.
For instance, different commands for Javascript docs vs. Applescript docs in Script Editor.