Where is the user macro file?
-
Hello, @harry-goldhagen, @peterjones, @alan-kilborn and All,
@harry-goldhagen said :
on first glance it seems like a very wordy macro language, with a line per character.
This sentence caught my attention ! I said to myself: could we put several characters, together, in the same
2170
instruction ?
For instance this simple text :
Test Second line !
will normally be recorded as :
<Macro name="Test" Ctrl="no" Alt="no" Shift="no" Key="0"> <Action type="1" message="2170" wParam="0" lParam="0" sParam="T" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="e" /> <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="
" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="
" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="S" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="e" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="c" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="o" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="n" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="d" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam=" " /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="l" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="i" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="n" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="e" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam=" " /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="!" /> </Macro>
So, I tried to cut down all this stuff with this version :
<Macro name="Test_1" Ctrl="no" Alt="no" Shift="no" Key="0"> <Action type="1" message="2170" wParam="0" lParam="0" sParam="Test
Second line !" /> </Macro>
And guess what ? It works nicely and this text is kept over N++ sessions, without any problem !
Note that it works with a very long sentence, too, as in this second test with the Preamble of the N++
license.txt
file :<Macro name="Test_2" Ctrl="no" Alt="no" Shift="no" Key="0"> <Action type="1" message="2170" wParam="0" lParam="0" sParam="The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too." /> </Macro>
So, one more thing to remember !
Alan, Peter, I hope that, this time, I don’t relay false news about the configuration file
shortcuts.xml
. Just experiment my assumption !Best Regards
guy038
P.S. :
Very hard to type this message because my pussy has just settled between my keyboard and me ;-)) The naughty one !
-
@guy038 Thanks everyone, lots to learn now! I’m just trying to simply automate web page creation for my static site.
-
@PeterJones I’m unfamiliar with scripting, is this also described in the manual? I have no programming skills, I only use Notepad++ for writing web pages and CSS files, so I’m hoping scripting is a straightforward feature…
-
@Harry-Goldhagen said in Where is the user macro file?:
I’m unfamiliar with scripting, is this also described in the manual? I have no programming skills, I only use Notepad++ for writing web pages and CSS files, so I’m hoping scripting is a straightforward feature…
Because scripting is done with a plugin, it wouldn’t be in the N++ manual.
If you have “no programming skills”, probably best to stay away from scripting. Unless you have a burning desire to acquire some of those skills.
-
@Alan-Kilborn Thanks, looks like I’ll stick to macros! By the way, I must say this is one of the most helpful forums I’ve ever used! The NPP crowd is very helpful. Glad a friend of mine recommended that I use it for html coding.
-
@Harry-Goldhagen said in Where is the user macro file?:
Glad a friend of mine recommended that I use it for html coding.
Just don’t ask your HTML coding questions here!
We don’t take kindly to that!
:-) -
@PeterJones said in Where is the user macro file?:
@Alan-Kilborn said in Where is the user macro file?:
Peter, I don’t know that info currently in the manual is anywhere close to as good as what you (and possibly I, if you agree) have said in this thread.
Yep: usermanual issue #139 created and assigned to me.
Pull Request #140 submitted.
( @Alan-Kilborn , during my investigation, I confirmed that cloud actually beats doLocalConf, rather than the other way around as you phrased it.)
-
@PeterJones said in Where is the user macro file?:
I confirmed that cloud actually beats doLocalConf, rather than the other way around as you phrased it.
Interesting.
It seems like the xml file should beat everything else, but I guess not.
At least it is documented well now.
Thanks to your efforts. -
More upcoming work for Peter on this: https://github.com/notepad-plus-plus/notepad-plus-plus/pull/9287
:-(
-
@Alan-Kilborn said in Where is the user macro file?:
:-(
It’s only going to be another sentence or two. Not a killer addition. ;-)
created usermanual issue #141
-
Hello,@Harry-Goldhagen
In Windows, the macros are saved at %AppData%\Notepad++\shortcuts.XMLOr
In Windows < 7 the macros are saved at C:\Documents and Settings%username%\Application Data\Notepad++\shortcuts.xml
In Windows 7|8|10 C:\Users%username%\AppData\Roaming\Notepad++\shortcuts.xml
Note: You will need to close Notepad++ if you have any new macros you want to ‘export’.I hope this information will be useful to you.
Thank you.