Hello, @ryan-jay-alfonso and All,
Ah, OK ! Here is the macro code that does the work :
<Macro name="Test_#" Ctrl="no" Alt="yes" Shift="no" Key="187"> <!-- Shortcut : ALT + = -->
<Action type="3" message="1700" wParam="0" lParam="0" sParam="" /> <!-- Search Initialisation -->
<Action type="3" message="1601" wParam="0" lParam="0" sParam="#$" /> <!-- Search Regex : # at END -->
<Action type="3" message="1625" wParam="0" lParam="2" sParam="" /> <!-- Regular Expression mode -->
<Action type="3" message="1702" wParam="0" lParam="512" sParam="" /> <!-- Search Downwards -->
<Action type="3" message="1701" wParam="0" lParam="1" sParam="" /> <!-- Hit on Find Next button -->
<Action type="0" message="2453" wParam="0" lParam="0" sParam="" /> <!-- Hit on HOME key -->
<Action type="1" message="2170" wParam="0" lParam="0" sParam="1" /> <!-- Writing of the digit 1 -->
<Action type="1" message="2170" wParam="0" lParam="0" sParam="0" /> <!-- Writing of the digit 0 -->
<Action type="1" message="2170" wParam="0" lParam="0" sParam="0" /> <!-- Writing of the digit 0 -->
<Action type="0" message="2451" wParam="0" lParam="0" sParam="" /> <!-- Hit on END key -->
</Macro>
Remark :
If you’re totally sure that the # only occurs, once, at the end of some specific lines, we can, simply, use the Normal search mode, giving the following macro code :
<Macro name="Test_#" Ctrl="no" Alt="yes" Shift="no" Key="187"> <!-- Shortcut : ALT + = -->
<Action type="3" message="1700" wParam="0" lParam="0" sParam="" /> <!-- Search Initialisation -->
<Action type="3" message="1601" wParam="0" lParam="0" sParam="#" /> <!-- Search of the # symbol -->
<Action type="3" message="1625" wParam="0" lParam="0" sParam="" /> <!-- Normal search mode -->
<Action type="3" message="1702" wParam="0" lParam="512" sParam="" /> <!-- Search Downwards -->
<Action type="3" message="1701" wParam="0" lParam="1" sParam="" /> <!-- Hit on Find Next button -->
<Action type="0" message="2453" wParam="0" lParam="0" sParam="" /> <!-- Hit on HOME key -->
<Action type="1" message="2170" wParam="0" lParam="0" sParam="1" /> <!-- Writing of the digit 1 -->
<Action type="1" message="2170" wParam="0" lParam="0" sParam="0" /> <!-- Writing of the digit 0 -->
<Action type="1" message="2170" wParam="0" lParam="0" sParam="0" /> <!-- Writing of the digit 0 -->
<Action type="0" message="2451" wParam="0" lParam="0" sParam="" /> <!-- Hit on END key -->
</Macro>
Now,
First, determine the location of your active shortcuts.xml configuration file. It depends if you have a local N++ install or not :
Along with the notepad++.exe file, for a local configuration, in any folder different from C:\Program files[(x86)]
In the path %AppData%\Notepad++, in case of use of the installer to install N++
Stop any Notepad++ instance
Insert 1 of the codes, above, in the <Macros>........</Macros> node of your active shortcuts.xml file and save it
Restart Notepad++
Select your file tab
Insert a dummy xxx# line, without line-break, at the very end of the file ( This line must satisfy the search ! )
Go to the very beginning of file ( Ctrl + Home )
Click on the Macros > Run a Macro Multiple Times... menu option
Select the Test_# macro, in the drop-down list
Choose the Run until the end of file option
Click on the Run button
Reminder : You must move to the very beginning of your file, before running the Run until the end of file option
Best Regards,
guy038