- AuthorPosts
- February 7, 2008 at 7:56 am #5410PeterParticipant
I suggest add option to use external tool as text filter.
1) Pass all / selected text to the stdin of external tool, capture the stdout of external tool, and replace all / selected text with it.
2) Copy all text to a temp file, process the temp file with external tool, and replace all text with content of the temp file.
EmE is unable to undo change if I process the current file directly with external tool, isn’t it?
February 7, 2008 at 7:29 pm #5413Yutaka EmuraKeymasterwhileloop wrote:
I suggest add option to use external tool as text filter.1) Pass all / selected text to the stdin of external tool, capture the stdout of external tool, and replace all / selected text with it.
2) Copy all text to a temp file, process the temp file with external tool, and replace all text with content of the temp file.
EmE is unable to undo change if I process the current file directly with external tool, isn’t it?
Thanks for your comments.
(1) I don’t know if you noticed, but you could use $(CurText) in the Arguments field in External Tools Properties.
(2) Thanks for input!
If you process current file, and reload with EmEditor, it will not be able to undo it.
February 7, 2008 at 8:18 pm #5416dandersonMemberEditPlus provides this feature. It passes the selected text (or the whole buffer if nothing is selected) to stdin and replaces the selected region or entire buffer with whatever is returned to std out. It’s very useful. You can undo the changes because the buffer is modified not the actual file on disk.
On the bright side. You can accomplish the same thing using macros. It works just as well and provides even more control. I can post an example if it is helpful.
February 8, 2008 at 1:07 am #5417Yutaka EmuraKeymasterYour macro should be very beneficial to all our users. Please post your macro, or email me at [email protected] after zipped. When you post or email your macro, please write a brief explanation so I can use in our library. Thanks!
February 8, 2008 at 6:46 am #5419PeterParticipant$(CurText) argument pass selected text as argument, but not to the stdin of external tool? So it is not possible to pass long string or that contain special chars.
BTW, the $(Prompt) arguement of editplus is also handy; more convenient than creating a macro. Not everyone know about WSH.
I also want to learn macro but don’t know where to start. Can I use function like ShowModal, ShowOpen, show a web page etc…? –> asked in macro forum
February 8, 2008 at 3:41 pm #5422dandersonMemberSent it with explanation in comments at the top of the file. Let me know if you have any questions.
February 8, 2008 at 10:28 pm #5423Yutaka EmuraKeymasterdanderson wrote:
Sent it with explanation in comments at the top of the file. Let me know if you have any questions.Uploaded to http://www.emeditor.com/modules/mydownloads/singlefile.php?cid=8&lid=231
Thanks!
- AuthorPosts
- You must be logged in to reply to this topic.