In visual studio I want a macro that takes the selected text, pipes it to a dos command, captures the resulting stream and replaces the selected text with it.
Something like this…
Dim objSel As TextSelection = DTE.ActiveDocument.Selection
objSel.Text = RunShellCommand("beautify.rb", objSel.Text)
..where I don’t know how to implement RunShellCommand.
It seems Shell("beautify.rb", 1) would execute a command and return the output, in which case all I need is .. “How do you stream text to the shell command?”
I have a work around using AutoHotKey (an excellent tool) and changing
beautify.rbto take a file.Now any text field in any app with sql in it can be beautiful 🙂