Running a script or quick action when double clicking a file?

A couple years ago I created a script to allow you to open Mac OS 9 apps and files in the Sheepshaver emulator from the (modern) macOS Finder in a way that is reminiscent of the “Classic” virtual machine that shipped with early versions of Mac OS X.

You can see what it is here: My attempt at integrating macOS 10+ with SheepShaver to try to make it act more like the Classic enviroment - E-Maculation

This is accomplished through the use of a Quick Action, so I have to right click the app or file I want to open, scroll down to quick actions, and select it from there. Ideally I would like to be able to just double click an old OS 9 app and have the script run, but I never was able to find a way to make that work. Do any of you know how to get a script in Automator, an apple script, or even a shell script to execute when trying to open an app or file?

This has been discussed here, a looong time ago.
Maybe you can find something useful there.