Yes but what's the difference between a "formatting program" and an editor that has a script loaded sitting there waiting for the paste? For all purposes the editor is an interpreter running your "formatting program."
Set it as default in Text Editor Anywhere. Select text, hit the hotkey. Hit Go to run the script in the editor. What's the difference?
-MilesAhead
Not much! Depends on how you look at it. I'd say one difference is focus - sometimes you can do things quicker and smoother using a dedicated tool. Such a tool is not an editor, so it can be more focused on the specific task, and in some ways do it better than an editor that has to worry about so much more.
Then there's the mechanics. If you're transforming a line of text, no difference. But very often I need to strip html or xml tags from a document so that I can spell-check it (the business app does not have a working spellchecker, either). The file may be 10 MB, most of which are tags. Sometimes there is not a single linebreak in those 10 MB of xml, because it was machine-generated and no linebreaks are needed for the document to be valid.
Now, if you'ever pasted 10 MB of XML as one line into a syntax-highlighting editor with word wrapping enabled... you know what happens. What happens depends on the editor, but typically it will chew on it for a long time before it will accept any more input from you. Especially if the syntax highlighting works from regular expressions.
Then you run the script, and it still takes more time than it has to, because the editor will maintain its undo buffer and update the display... All these can be turned off, sure. But a dedicated app doesn't need to paste the mess anywhere, doesn't need undo, doesn't refresh the screen, so it can do the work in a fraction of the time a full editor will take.
Then there are little things, like whether you can assign shortcuts to macros in the editor for faster execution. Trivial molehills that tend to become mountains when you repeat them over and over for years. Sixteen years in my case; I'm ready for an improvement :-)