Update: exporting the AppleScript as an app and executing it from KM works as intended, so that’s the method I’ll use for the time being. But if anybody has some insight on my original question I’d still love to hear it because executing it as a scpt
file is preferable because it makes it easier to modify it in the future.