Thursday, 6 December 2018

Create a shortcut for Notepad++ to reopen a closed tab?


To reopen a closed tab in Notepad++ you press ALT+F&1. I was wondering if there was a way to make a macro or program to do this so that I can press link it to the shortcut CTRL+SHIFT+T instead, which is a universal reopen closed tab shortcut I'm used to.


If anyone could tell me how to make a simple program that does that, and that I could then link to Notepad++ to create a shortcut with, that would teach me a lot and help.


Thank you for reading



Answer



I have successfully tested the following solution: define this AutoHotKey macro:


SendMode Input                ;just to set up preferred method of sending hotkeys
SetTitleMatchMode, RegEx ;from now on, windows titles are matched by regex

#IfWinActive Notepad\+\+ ;(open block) the following hotkeys work only in N++
+^t::Send !f1 ;desired hotkey: Ctrl+Shift+T sends Alt+F, 1
^w::Send ^{F4} ;bonus: Ctrl+W sends Ctrl+F4 (close file convention)
#IfWinActive ;(close #IfWinActive block)

do not forget to run AutoHotKey as administrator.


Using the AHK you can achieve many useful things in N++ and all other applications.


No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...