I started maintaining work notes in a text document, pre Evernote/OneNote days, say in a file named worknotes.txt. I add code, tips, tricks, queries, urls etc to this file with some comments.
I have been using TextPad where I created a shortcut to always open this file by pressing Ctrl+1. But I can no longer use TextPad and am forced to use Notepad++ (Notepad++ v 7.8.2).
How do I create a shortcut in Notepad++? I tried creating a macro but the macro doesn't work. I created it by menu option Macro - Start Recording - File - Open - type the file name etc and then Stop Recording. To test my macro, I selected menu option Macro - Playback but it didn't work.
To verify that I am recording the macro, I created other simple macros like find/replace certain string OR insert a single quote to the beginning & end of the lines in a file and all these macros run properly.
Any thoughts/tips/pointers?
Thanks.
Instead of a Macro you may want to use Run
from the main menu to open your file and add a shortcut for this as shown in the screenshot below.
Update: Steps for adding shortcut
From the main menu goto Run > Run or press the F5 key. Copy the following (previously adapted) call into the text box and SAVE
"$(NPP_FULL_FILE_PATH)" "d:\_temp\my-file.txt"
$(NPP_FULL_FILE_PATH)
is the full drive, folder, and executable for the active instance of notepad.exe; the quotes are needed if there are spaces in Notepad++'s path."d:\_temp\my-file.txt"
with the correct path to your file; if there are spaces in the filename, it must have the quotes around it.In the next dialog name it Open My File or similar, assign keyboard shortcut e.g Ctrl+F12 click OK and Run to run it immediately or Cancel.
Now the Run menu will contain Open My File, and that menu entry (and keyboard shortcut) will quickly open the desired file.
And %AppData%\Notepad++\shortcuts.xml
will contain lines like this:
<UserDefinedCommands>
<Command name="Get PHP help" Ctrl="no" Alt="yes" Shift="no" Key="112">https://www.php.net/$(CURRENT_WORD)</Command>
<Command name="Wikipedia Search" Ctrl="no" Alt="yes" Shift="no" Key="114">https://en.wikipedia.org/wiki/Special:Search?search=$(CURRENT_WORD)</Command>
<Command name="Open my File" Ctrl="no" Alt="yes" Shift="yes" Key="120">"C:\Program Files\Notepad++\notepad++.exe"</Command>
</UserDefinedCommands>