I vaguely recall a hook that added TextMate to macOS input fields, but it would open a document in the usual TextMate app. That is to say, you'd be switching between apps, banging between the input field and TextMate.
Still, it saved a bit of work: you would simply close the document and the text would be saved into the input field.
Wow, thanks a lot for your work! I've been looking for something similar for a while, and it's the first time it's been implemented properly. Please consider adding a "Sponsor" button on your profile, I'll be glad to support your work