Viewing 3 posts - 1 through 3 (of 3 total)
- AuthorPosts
- February 16, 2022 at 9:11 pm #28051Display ErrorParticipant
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!
February 22, 2022 at 8:23 am #28061Yutaka EmuraKeymasterIf 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
February 22, 2022 at 8:33 am #28062Display ErrorParticipantI 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 :) - AuthorPosts
Viewing 3 posts - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.