Macro shortcut breaks after update
-
I have a macro and I’ve assigned a shortcut for it. It inserts a solid black circle with a space after it, and the shortcut is Ctrl+. (The full stop is part of the shortcut.)
I use the portable zip version of Npp so whenever I update I skip extracting the shortcuts.xml file to preserve my macros and shortcuts. All of them work fine after updating except for the circle shortcut. After updating, it no longer inserts the circle. Instead, it inserts the unicode hex character code from the xml file. The code is as follows but I’ve inserted a space between the first two characters otherwise the circle is what you’ll see: & #x25CF;
I haven’t been able to figure out what causes it so, after updating, I have to delete the macro, re-record the macro and re-assign the shortcut. I’m kind of guessing that it may have something to do with a file other than the shortcuts one but if anyone can tell me for sure, I’d be very grateful.
-
-
@Alan-Kilborn said in Macro shortcut breaks after update:
You probably want to see the FAQ, HERE.
Thank you so much! After reading the FAQs I did recall having read that but completely forgot about it by the time I got around to updating.
-
@Alan-Kilborn said in Macro shortcut breaks after update:
You probably want to see the FAQ, HERE.
After checking all my other macros, I discovered that the one I have that has " and ’ as replacements didn’t work when I replaced the XML entities with the literal characters. In fact it broke the shortcuts file so that none of my macros were displayed in the Macro menu. I thought I must have done something wrong so I re-recorded the macro and discovered it was still stored as the XML entities. Are " and ’ not special characters?
-
I cannot test right now, but if you can break up you text into sections, I think you can use
sParam='"'
(single, double, single) for getting the double quote in your macros. I think the string portions that have only single quotes will go fine in the normal attribute value syntax. -
Good News
I ran some experiments: the following macro works the same in v8.5.2 (the last version before the macro change) and v8.5.3 and v8.5.4.
<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>
This means that the five predefined XML named entities all work, as do the two-hex-digit entities for CR and LF (and, not shown, a test of all the two-hex-digit entities for visible ASCII characters from
 
through~
all work as well). So this is going to make your job even simpler: to include a quote mark inside thesParam
, you can encode it assParam="""
or assParam="""
. I wil be updating the FAQ shortly. -
@PeterJones said in Macro shortcut breaks after update:
Good News
I ran some experiments: the following macro works the same in v8.5.2 (the last version before the macro change) and v8.5.3 and v8.5.4.
This means that the five predefined XML named entities all work, as do the two-hex-digit entities for CR and LF (and, not shown, a test of all the two-hex-digit entities for visible ASCII characters from
~
all work as well). So this is going to make your job even simpler: to include a quote mark inside thesParam
, you can encode it assParam="""
or assParam="""
. I wil be updating the FAQ shortly.Thanks Peter 🙂