Copying highlighted text lines from 1 Notepad++ file to another
-
@guy038 said in Copying highlighted text lines from 1 Notepad++ file to another:
fully copy/pastes the 5 style tokens, as well as the mark style and the Incremental search style
Actually, the “incremental search style” isn’t handled by the provided scripts.
The reason is that it is too “dynamic”.
The other styles have more “permanence” to them.One could certainly add it to the list in the “copy-special” script code, though (no need for it to be in the “paste-special” code). Here are the details about it from the N++ source:
#define SCE_UNIVERSAL_FOUND_STYLE_INC 28
-
Your time and efforts are Much Appreciated! I am admittedly a Notepad++ newbie when it comes to scripts and customization. Maybe you can point me to a YouTube video or video screenshare which shows me how to integrate these scripts. Thanks Again!
-
Someday we’ll turn the generic procedure into a FAQ.
Steps:
- Use Plugins admin to install the PythonScript plugin
- Menu to Plugins > Python Script > New Script
- Provide a (file) name for the script; you don’t need to specify an extension –
.py
will be added automatically - Press the Save button to close out the Save As dialog box.
- At this point your script file will be showing and is empty; copying and pasting one of the scripts from above seems like a fine idea :-)
- Save the file
- To execute your script, menu to Plugins > Python Script >Scripts > (pick the name of your script)
If you can successfully get that far with it, we can explain to you how to bind a keycombo to it to execute the script that way (which is better than menuing for an often-used script).
-
Hi, @alan-kilborn and All,
when I did the test, I used the maximum number of styles and I didn’t notice that the
incremental search
style was not copied !Cheers,
guy038
-
Actually (thinking more about it), if you want the Incremental Search or even the Smart Highlighting color to be part of the copy/paste, upon pasting it will lose its temporal nature and becomes permanent! So that’s a way to get a few more colors with this technique!
Here’s the info for Smart Highlighting :
#define SCE_UNIVERSAL_FOUND_STYLE_SMART 29
And so, here’s a modification to a section of the “copy special” script to include these:
# the following names are from the N++ source code: SCE_UNIVERSAL_FOUND_STYLE_EXT1 = 25 # Style #1 SCE_UNIVERSAL_FOUND_STYLE_EXT2 = 24 # Style #2 SCE_UNIVERSAL_FOUND_STYLE_EXT3 = 23 # Style #3 SCE_UNIVERSAL_FOUND_STYLE_EXT4 = 22 # Style #4 SCE_UNIVERSAL_FOUND_STYLE_EXT5 = 21 # Style #5 SCE_UNIVERSAL_FOUND_STYLE = 31 # redmarking style SCE_UNIVERSAL_FOUND_STYLE_INC = 28 # incremental-search style SCE_UNIVERSAL_FOUND_STYLE_SMART = 29 # smart-highlighting style indicator_list = [ SCE_UNIVERSAL_FOUND_STYLE_EXT1, SCE_UNIVERSAL_FOUND_STYLE_EXT2, SCE_UNIVERSAL_FOUND_STYLE_EXT3, SCE_UNIVERSAL_FOUND_STYLE_EXT4, SCE_UNIVERSAL_FOUND_STYLE_EXT5, SCE_UNIVERSAL_FOUND_STYLE, SCE_UNIVERSAL_FOUND_STYLE_INC, SCE_UNIVERSAL_FOUND_STYLE_SMART, ]
-
So, I am having issues installing the Python Script plugin (N++ newbie)
My N++ version is V7.6.1 with 32-bit
N++ > Plugin Admin does not find Python Script at allFollowed the instructions here for installing the Python Script plugin
https://community.notepad-plus-plus.org/topic/17256/guide-how-to-install-the-pythonscript-plugin-on-notepad-7-6-3-7-6-4-and-aboveHere is screenshots of my file setup:
https://www.screencast.com/t/27yUQwOE
https://www.screencast.com/t/i80RUZMCuOd2Screenshot of N++ Plugin Admin
https://www.screencast.com/t/8RGSUO0rwPlease help me understand where I am going wrong
Much Appreciated
George -
@George-Rogers said in Copying highlighted text lines from 1 Notepad++ file to another:
My N++ version is V7.6.1 with 32-bit
So I think around the time of v.7.6.1, Plugins Admin was going through some growing pains.
That may be causing the trouble.
Any issues with updating to v.7.8.6, say?
You can certainly stick with the 32-bit version if you want. -
I can give that a shot
How would I unwind that update and revert back to V7.6.1 in case I needed to? -
Personally I would download a zipped version as it can run
in parallel to an installed version. -
@Alan-Kilborn said in Copying highlighted text lines from 1 Notepad++ file to another:
…how to bind a keycombo to it to execute the script that way (which is better than menuing for an often-used script).
Some instructions for that are found in THIS POSTING.
-