If you’re looking to automate a custom URL scheme that opens files with their default application, check out my open‑source project OpenFileURL. It’s an AppleScript‑based handler that registers an open://
scheme, decodes a percent‑encoded file path, and then launches the file using the default app.
I made it after running into the use case that you described here— hopefully this can help someone!