Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #5410
    Peter
    Participant

    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?

    #5413
    Yutaka Emura
    Keymaster

    whileloop 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.

    #5416
    danderson
    Member

    EditPlus 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.

    #5417
    Yutaka Emura
    Keymaster

    Your 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!

    #5419
    Peter
    Participant

    $(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

    #5422
    danderson
    Member

    Sent it with explanation in comments at the top of the file. Let me know if you have any questions.

    #5423
    Yutaka Emura
    Keymaster

    danderson 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!

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.