Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #28051
    Display Error
    Participant

    Hello,
    I’d like select some text which is a file path e.g.
    C:\temp\file.txt
    and run a macro to open that file path in EmEditor (I can then assign that macro to the context menu).

    I tried to record a macro; it copies the highlighted text but obviously stops recording at the Open Dialog.
    I also tried the following code, but I clearly don’t know what I’m doing!

    document.selection.Copy(eeCopyUnicode);
    editor.OpenFile(eeCopyUnicode);

    Thank you for any help!

    #28061
    Yutaka Emura
    Keymaster

    If you would like to open the selected path, you can write a macro like this:

    editor.OpenFile( document.selection.Text, 0, eeOpenAllowNewWindow );
    

    Please see: http://www.emeditor.org/en/macro_editor_editor_openfile.html

    #28062
    Display Error
    Participant

    I seee! So there’s no need to copy the text to clipboard, just use the actual selected text! The macro documentation makes more sense to me now :)
    Thanks a lot Yutaka, that works perfectly :)

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