Another follow-up:
Here is a compiled version of the last Swift script (runs faster).
getDefaultEditorForContentType.zip (20.8 KB)
->->-> Put it somewhere in your PATH. <-<-<-
This version now also takes multiple arguments; example in the Terminal:
Or with KM:
…or: