Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #6498
    LuK
    Member

    Hi everybody,

    is it possible to replace every text in the whole document which is stored in the clipboard?

    eg:

    to_replace = clipboardData.getData(“Text”)
    document.selection.Replace to_replace,””,eeReplaceAll

    regards
    Thorsten

    #6507
    Yutaka Emura
    Keymaster

    LuK wrote:
    Hi everybody,

    is it possible to replace every text in the whole document which is stored in the clipboard?

    eg:

    to_replace = clipboardData.getData(“Text”)
    document.selection.Replace to_replace,””,eeReplaceAll

    regards
    Thorsten

    Yes, but you will need to use regular expressions built in the script, not EmEditor macro methods. You should refer to regular expression tutorials for JavaScript. See also: http://www.emeditor.com/help/macro/tutorial/tutorial_regexp.htm

    After you do any replace with “to_replace”, you can copy the text back to the clipboard by using:

    clipboardData.setData(“Text”, to_replace)

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