HELP: Having trouble with Macros in v8.5.3 or later
-
Hello, @massimo-piscopo and All,
I suppose that you have a standard installation with N++ installer ! Then, you must look for the real location of your
shortcuts.xml
file !
Follow the steps, below :
-
Open your Notepad++
v8.5.3
, as usual -
Click on the
Windows Logo
key and, simultaneously, hit theR
key -
In the Execute window, type in
Explorer.exe
and hit theEnter
key
=> The File Explorer program should start
-
Clic on the ‘STAR’ and type in the string
%appdata%\Notepad++
-
Valid with the
Enter
key
=> You should normally see a
shortcuts.xml
file, along with some others files- Clic on the
shortcuts.xml
file and drag this file into your notepad++ window
=> You should see, in the
<Macros>
section, your macro namedcalcio (prime correczioni)
-
Now, open the Replace dialog (
Ctrl + H
) -
Untick all box options
-
SEARCH
‘
-
REPLACE
\x{2018}
-
Check the
wrap around
option -
Select the
Regular expression
search mode ( IMPORTANT ) -
Click on the
Replace All
button -
Save the changes of your
shortcuts.xml
file -
Close Notepad++
-
Restart Notepad++
=> Your macro should be OK and do what it is designed for :-)
Best Regards,
guy038
-
-
I don’t find it in
shortcuts.xml
It’s there, or your macro doesn’t exist when you exit Notepad++ and restart. Did you look in the right
shortcuts.xml
?If you had read the first post in this discussion, you would have seen the we asked you to supply your ?-menu’s Debug Info. Because you chose not to do so, we have to assume the location of your
shortcuts.xml
is in%AppData%\Notepad++\shortcuts.xml
, as @guy038 guessed while I was typing this. -
@guy038 and @PeterJones THANK YOU SO MUCH, I’ve solved. <3
-
@datatraveller1 said in HELP: Having trouble with Macros in v8.5.3 or later:
@wonkawilly As far as I have understood @guy038 and the FAQ, you simply have to replace the old values UTF-8 encoded literally with
è
,à
etc.I’m not sure if something like Python would work for the macro system but I partly agree that it is a bit ugly sometimes - In my case I don’t like that real line breaks get inserted into shortcuts.xml.
It should be good enough to see it replaced with “\r\n” as in regular expression syntax. Nevertheless, that solution would of course be good just to “survive”, not in the long run, because nevertheless the optimus would be to have a complete new macro system as in LibreOffice, MsOffice and so on. It would be a huge improvement even replacing the current macro system in npp with a new macro system based on AutoIt language and macro recorder.
The current macro system is too cryptic and too limited. Compare this row
<Action type=“1” message=“2170” wParam=“0” lParam=“0” sParam=“è” />
with its equivalent in a simple scripting language in which you can even do loops or if/else and so much more.
IMHO the current macro system in N++ is going old… and really needs retirement, better sooner than later…
Also another ugly thing is that n++ saves new recorded macros only on exit: it would be better to save new created macros on click on the Save Macro button so they could be edited without the need of restarting npp: other ugly and incomprehensible thing. -
Moving to the next bookmark does not work inside a macro. No matter where the cursor is, it will always go to a specific bookmark.
-
@Cement-Knight said in HELP: Having trouble with Macros in v8.5.3 or later:
Moving to the next bookmark does not work inside a macro. No matter where the cursor is, it will always go to a specific bookmark.
You might want to start a new thread with that, as it is very unrelated to previous conversation in this thread.
-
Good News
It turns out that XML’s five predefined named-entities still work even in Notepad++ v8.5.3 and newer. Also, the entities made up of two hex digits still work.
The following macro shows the named entities that still work in macro sParam values with v8.5.3 and newer, as well as showing how to get a
CRLF
newline sequence using the two-hex-digit entities. You can use this as an example for when you are manually editing your macros to work for v8.5.3 and newer:<Macro name="XML Named Entities" Ctrl="no" Alt="no" Shift="no" Key="0"> <Action type="1" message="2170" wParam="0" lParam="0" sParam="&" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="<" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam=">" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="'" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam=""" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="
" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="
" /> </Macro>
And here are all the two-digit hex entities for ASCII characters from 1 to 127:
<Macro name="ASCII 2-digit Hex Entities" Ctrl="no" Alt="no" Shift="no" Key="0"> <Action type="1" message="2170" wParam="0" lParam="0" sParam="" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="	" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="
" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="
" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="
" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="
" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="
" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="
" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam=" " /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="!" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam=""" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="#" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="$" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="%" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="&" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="'" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="(" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam=")" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="*" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="+" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="," /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="-" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="." /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="/" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="
" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="
" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="0" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="1" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="2" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="3" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="4" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="5" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="6" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="7" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="8" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="9" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam=":" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam=";" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="<" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="=" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam=">" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="?" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="
" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="
" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="@" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="A" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="B" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="C" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="D" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="E" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="F" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="G" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="H" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="I" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="J" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="K" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="L" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="M" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="N" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="O" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="
" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="
" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="P" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="Q" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="R" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="S" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="T" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="U" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="V" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="W" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="X" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="Y" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="Z" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="[" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="\" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="]" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="^" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="_" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="
" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="
" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="`" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="a" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="b" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="c" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="d" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="e" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="f" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="g" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="h" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="i" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="j" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="k" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="l" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="m" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="n" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="o" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="
" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="
" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="p" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="q" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="r" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="s" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="t" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="u" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="v" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="w" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="x" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="y" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="z" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="{" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="|" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="}" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="~" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="
" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="
" /> </Macro>
The FAQ has been updated to match this new information.
-
Moderator Note: The contents of this post were moved to a separate topic, Macro works normally, but fails when shortcut is Ctrl+Shift+C, because it’s actually separate from the >=v8.5.3 issue for this Topic.
-
-