Activity for Notepad++ Python Script

  • Sasumner Sasumner posted a comment on discussion Open Discussion

    "you cannot make application modal windows in Notepad++" --> This is NOT true. "please correct me and show how" --> I'm not going to show you how with Tcl/Tk, because I don't like and don't use it. The capability can be easily demonstrated with this little UI toolkit that a PythonScript user created: https://community.notepad-plus-plus.org/topic/24389 Suggest you check that out and if you have further questions, post to the community site and someone there will help you out.

  • Karel A Karel A posted a comment on discussion Open Discussion

    The problem with Pythonscript is that you cannot make application modal windows in Notepad++ with Tcl/Tk (or any other GUI framework, as far as I know...), i.e. a window that stays on top within Notepad++, until the user closes it. You can make a system modal window, but not an application modal window. This is a rather severe limitation for Python scripts, as you mostly want the user to be able to interact with the script through a graphical user interface (a listbox or whatever). If I am wrong,...

  • Jun Wang Jun Wang posted a comment on discussion Help

    How to loop through a list of strings strs and Find all in current document for each string and show the results in the result panel via python?

  • Kadner Kadner modified a comment on discussion Help

    At first sight, NPP 8.4.8 with PythonScript2.0 apparently did the trick! (One only needed to install the missing unidecode module). Thanks a lot for the (prompt) response. However on closer inspection the problem lied in a patched 'sys.path' in MY now OLD custom startup.py which resulted in missing python27\DLLs folder in the path... (this was meant to circumvent the error thrown by PythonScript when it imported pygtk module)

  • Kadner Kadner modified a comment on discussion Help

    At first sight, NPP 8.4.8 with PythonScript2.0 apparently did the trick! (One only needed to install the missing unidecode module). Thanks a lot for the (prompt) response. However on closer inspection the problem lied in a patched 'sys.path' in my now OLD custom startup.py which resulted in missing python27\DLLs folder in the path... (this was meant to circumvent the error thrown by PythonScript when it imported pygtk module) (As a side comment, I note that the new PythonScript Plugin no longer list...

  • Kadner Kadner modified a comment on discussion Help

    At first sight, NPP 8.4.8 with PythonScript2.0 apparently did the trick! (One only needed to install the missing unidecode module). Thanks a lot for the (prompt) response. However on closer inspection the problem lied in a patched 'sys.path' of my now OLD custom startup.py which resulted in missing python27\DLLs folder in the path... (this was meant to circumvent the error thrown by PythonScript when it imported pygtk module)

  • Kadner Kadner modified a comment on discussion Help

    At first sight, NPP 8.4.8 with PythonScript2.0 apparently did the trick! (One only needed to install the missing unidecode module). Thanks a lot for the (prompt) response. On closer inspection the problem lied in a patched 'sys.path' of my now OLD custom startup.py which resulted in missing python27\DLLs folder in the path... (this was meant to circumvent the error thrown by PythonScript when it imported pygtk module)

  • Kadner Kadner modified a comment on discussion Help

    At first sight, NPP 8.4.8 with PythonScript2.0 apparently did the trick! (One only needed to install the missing unidecode module). Thanks a lot for the (prompt) response. On closer inspection the problem lied in a patched 'sys.path' of my now OLD custom startup.py which resulted in missing python\DLLs folder in the path... (this was meant to circumvent the error thrown by PythonScript when it imported pygtk module)

  • Kadner Kadner modified a comment on discussion Help

    At first sight, NPP 8.4.8 with PythonScript2.0 apparently did the trick! (One only needed to install the missing unidecode module). Thanks a lot for (prompt) response. On closer inspection the problem lied in a patched 'sys.path' of my now OLD custom startup.py which resulted in missing python\DLLs folder in the path... (this was meant to circumvent the error thrown by PythonScript when it imported pygtk module)

  • Kadner Kadner posted a comment on discussion Help

    NPP 8.4.8 with PythonScript2.0 did the trick! (Only needed to install unidecode module) Thanks a lot for (prompt) response.

  • Sasumner Sasumner posted a comment on discussion Help

    The first thing I would do would be to update to the latest 64-bit N++ and PythonScript 2.0.

  • Kadner Kadner modified a comment on discussion Help

    Running Npp 8.2.1. 64b Installed Plugin PythonScript 1.5.4.0 Problems trying to run supplied " ...\Scripts\Samples\sorter.py" script Fixed "from unidecode import unidecode" module not found error by copying extracted folder from package in " ...\lib " folder Now stuck with error showing in console: File "C:\Users\admin\AppData\Roaming\Notepad++\plugins\Config\PythonScript\scripts\Sorter.py", line 8, in <module> import Tkinter as tk File "C:\Program Files\Notepad++\plugins\PythonScript\lib\lib-tk\Tkinter.py",...

  • Kadner Kadner modified a comment on discussion Help

    Running Npp 8.2.1. 64b Installed Plugin PythonScript 1.5.4.0 Problems trying to run supplied " ...\Scripts\Samples\sorter.py" script Fixed "from unidecode import unidecode" module not found error by copying extracted folder from package in " ...\lib " folder Now stuck with error showing in console: File "C:\Users\admin\AppData\Roaming\Notepad++\plugins\Config\PythonScript\scripts\Sorter.py", line 8, in <module> import Tkinter as tk File "C:\Program Files\Notepad++\plugins\PythonScript\lib\lib-tk\Tkinter.py",...

  • Kadner Kadner modified a comment on discussion Help

    Running Npp 8.2.1. 64b Installed Plugin PythonScript 1.5.4.0 Problems trying to run supplied " ...\Scripts\Samples\sorter.py" script Fixed "from unidecode import unidecode" module not found error by copying extracted folder from package in " ...\lib " folder Now stuck with error showing in console: File "C:\Users\admin\AppData\Roaming\Notepad++\plugins\Config\PythonScript\scripts\Sorter.py", line 8, in <module> import Tkinter as tk File "C:\Program Files\Notepad++\plugins\PythonScript\lib\lib-tk\Tkinter.py",...

  • Kadner Kadner modified a comment on discussion Help

    Running Npp 8.2.1. 64b Installed Plugin PythonScript 1.5.4.0 Problems trying to run supplied " ...\Scripts\Samples\sorter.py" script Fixed "from unidecode import unidecode" module not found error by copying extracted folder from package in " ...\lib " folder Now stuck with error showing in console: File "C:\Users\admin\AppData\Roaming\Notepad++\plugins\Config\PythonScript\scripts\Sorter.py", line 8, in <module> import Tkinter as tk File "C:\Program Files\Notepad++\plugins\PythonScript\lib\lib-tk\Tkinter.py",...

  • Kadner Kadner modified a comment on discussion Help

    Running Npp 8.2.1. 64b Installed Plugin PythonScript 1.5.4.0 Problems trying to run supplied " ...\Scripts\Samples\sorter.py" script Fixed "from unidecode import unidecode" module not found error by copying extracted folder from package in " ...\lib " folder Now stuck with error showing in console: File "C:\Users\admin\AppData\Roaming\Notepad++\plugins\Config\PythonScript\scripts\Sorter.py", line 8, in <module> import Tkinter as tk File "C:\Program Files\Notepad++\plugins\PythonScript\lib\lib-tk\Tkinter.py",...

  • Kadner Kadner modified a comment on discussion Help

    Running Npp 8.2.1. 64b Installed Plugin PythonScript 1.5.4.0 Problems trying to run supplied " ...\Scripts\Samples\sorter.py" script Fixed "from unidecode import unidecode" module not found error by copying extracted folder from package in " ...\lib " folder Now stuck with error showing in console: File "C:\Users\admin\AppData\Roaming\Notepad++\plugins\Config\PythonScript\scripts\Sorter.py", line 8, in <module> import Tkinter as tk File "C:\Program Files\Notepad++\plugins\PythonScript\lib\lib-tk\Tkinter.py",...

  • Kadner Kadner posted a comment on discussion Help

    Running Npp 8.2.1. 64b Installed Plugin PythonScript 1.5.4.0 Problems trying to run supplied " ...\Scripts\Samples\sorter.py" script Fixed "from unidecode import unidecode" module not found error by copying extracted folder from package in " ...\lib " folder Now stuck with error showing in console: File "C:\Users\admin\AppData\Roaming\Notepad++\plugins\Config\PythonScript\scripts\Sorter.py", line 8, in <module> import Tkinter as tk File "C:\Program Files\Notepad++\plugins\PythonScript\lib\lib-tk\Tkinter.py",...

  • Sasumner Sasumner posted a comment on discussion Open Discussion

    You could use Tk that comes with a full install of PythonScript. (I never liked Tk) I suppose you could use Windows low-level API for creating/managing windows, but that sounds, well, exhausting. I make do with the "prompt" function; here's an example: https://community.notepad-plus-plus.org/post/28702

  • Michael Warwick Michael Warwick posted a comment on discussion Open Discussion

    I'm liking having Python in Npp and have a couple of working scripts that are helping with my work, one of them would be even better if I could get a few inputs, (about 5 yes/no inputs and a couple of text items) so I'd like to pop up a dialog. The message box and inputs are not quite enough, I'm looking for an example script that puts up a dialog with a few inputs and then uses those values.

  • Sasumner Sasumner posted a comment on discussion Script Showcase

    No idea. You can always open an issue about it here: https://github.com/bruderstein/PythonScript/issues I use CT without problem, but I always put my script icons to the right end of the toolbar anyway (it is where I want them so I've never tried anything else).

  • kiwichick kiwichick posted a comment on discussion Script Showcase

    Yes I did initially use CT, but I ran into a problem. Whenever I use the CT button, the next time I start Npp, the button has moved to the end of the toolbar. I've checked on a clean install of Npp with only CT and PS installed and it still does it. So I decided to check out the PS method. However, I think I'd rather have a button I know the name of than worry about its placement on the toolbar so I'll stick with the CT one. Do you know if there's likely to be a fix for the name issue with PS bu...

  • Sasumner Sasumner posted a comment on discussion Script Showcase

    Yea, it's a known issue. You can get better results if you use the CustomizeToolbar plugin and set up the button that way.

  • kiwichick kiwichick posted a comment on discussion Script Showcase

    When adding a script to the toolbar then hovering over the toolbar button, why isn't the script name shown? Instead it just says "Python Script" followed by a number. I find this very un-user-frirendly.

  • Sasumner Sasumner posted a comment on discussion Help

    Post this question here and you'll get some good responses: https://community.notepad-plus-plus.org/

  • John Doe John Doe posted a comment on discussion Help

    Hello everyone! I am working on a Script and would like to know if it is possible to add some kind of loading screen functionality. My script manipulates large files and it takes a few seconds to see the changes after running it. Is there any way I can add in a loading screen that terminates when the script has completed running? That way the user has a clearer picture of when the script actually finished executing. Any help would be greatly appreciated, thanks a bunch!

  • Kadner Kadner modified a comment on discussion Script Showcase

    Updated 2022/03/31 Moved python-code in separate downloadable file. Precious code indentation and lines were missing on earlier version of post due to errors in formatting ... Updated 2015/04/21 Made code cleaner. Expanded to include all possible matching bracket pairs. Included 2-selections concept from Davey https://sourceforge.net/p/npppythonscript/discussion/1199074/thread/4691495a/#d4a9 . I thought I would share this code as a token of appreciation after having learned from reading code examples...

  • Kadner Kadner modified a comment on discussion Script Showcase

    Updated 2022/03/31 Moved python-code in separate downloadable file as indentation is lost when copying to post Updated 2015/04/21 Made code cleaner. Expanded to include all possible matching bracket pairs. Included 2-selections concept from Davey https://sourceforge.net/p/npppythonscript/discussion/1199074/thread/4691495a/#d4a9 . I thought I would share this code as a token of appreciation after having learned from reading code examples from so many other programmers. filename : Swap_Items.py Thank...

  • Kadner Kadner modified a comment on discussion Script Showcase

    Updated 2022/03/31 Moved python-code in separate downloadable file as indentation is lost when copying to post Updated 2015/04/21 Made code cleaner. Expanded to include all possible matching bracket pairs. Included 2-selections concept from Davey https://sourceforge.net/p/npppythonscript/discussion/1199074/thread/4691495a/#d4a9 . I thought I would share this code as a token of appreciation after having learned from reading code examples from so many other programmers. filename : Swap_Items.py Thank...

  • Kadner Kadner modified a comment on discussion Script Showcase

    Updated 2022/03/31 Moved python-code in separate downloadable file as indentation is lost when copying to post Updated 2015/04/21 Made code cleaner. Expanded to include all possible matching bracket pairs. Included 2-selections concept from Davey https://sourceforge.net/p/npppythonscript/discussion/1199074/thread/4691495a/#d4a9 . I thought I would share this code as a token of appreciation after having learned from reading code examples from so many other programmers. filename : Swap_Items.py Thank...

  • Kadner Kadner modified a comment on discussion Script Showcase

    Updated 2022/03/31 Moved python-code in separate downloadable file as indentation is lost when copying to post Updated 2015/04/21 Made code cleaner. Expanded to include all possible matching bracket pairs. Included 2-selections concept from Davey https://sourceforge.net/p/npppythonscript/discussion/1199074/thread/4691495a/#d4a9 . I thought I would share this code as a token of appreciation after having learned from reading code examples from so many other programmers. filename : Swap_Items.py Thank...

  • Kadner Kadner modified a comment on discussion Script Showcase

    Updated 2015/04/21 Made code cleaner. Expanded to include all possible matching bracket pairs. Included 2-selections concept from Davey https://sourceforge.net/p/npppythonscript/discussion/1199074/thread/4691495a/#d4a9 . I thought I would share this code as a token of appreciation after having learned from reading code examples from so many other programmers. I named it Swap_Items.py. Thank you all 'pythoners'. Comments are welcome! ~~~~~~ ''' PURPOSE There is often a need to switch the position...

  • saih_tam saih_tam modified a comment on discussion Help

    I’m extremely grateful to @mpheath who gave me the solution “clé en main” (ready to use). I have understood it thanks to his explanations. I have implemented both Notepad++ Python Script and Standalone recursive Python Script : both work perfectly. I might even consider changing more elements very easily (thanks to list ‘presets’), and, amazing, modify the 5000 files without open them in Notepad++ (a lot of time saving). That’s a lot more than I expected. BIG THANKS to @mpheath and other for contributions...

  • saih_tam saih_tam modified a comment on discussion Help

    I’m extremely grateful to @mpheath who gave me the solution “clé en main” (ready to use). I have understood it thanks to his explanations. I have implemented both Notepad++ Python Script and Standalone recursive Python Script : both work perfectly. I might even consider changing more elements very easily (thanks to list ‘presets’), and, amazing, modify the 5000 files without open them in Notepad++ (a lot of time saving). That’s a lot more than I expected. BIG THANKS to @mpheath and other for contributions...

  • saih_tam saih_tam posted a comment on discussion Help

    I’m extremely grateful to @mpheath who gave me the solution “clé en main” (ready to use). I have understood it thanks to his explanations. I have implemented both Notepad++ Python Script and Standalone recursive Python Script : both work perfectly. I might even consider changing more elements very easily (thanks to list ‘presets’), and, amazing, modify the 5000 files without open them in Notepad++ (a lot of time saving). That’s a lot more than I expected. BIG THANKS to @mpheath and other for contributions...

  • saih_tam saih_tam posted a comment on discussion Help

    I re-wrote my algorithm to simplify it : Open : 'song.ini' Desactivate 'back line auto' in 'display' Desactivate numeric keypad Start macro # move "name =" If (find("name =") == true) : cut ("name =" line with precedent line break) and paste it after ("[song]" line); Else : create a line after ("[song]" line) and write "name = "; # move "artist =" If (find("artist =") == true) : cut ("artist =" line with precedent line break) and paste it after ("name =" line); Else : create a line after ("name ="...

  • saih_tam saih_tam modified a comment on discussion Script Showcase

    I duplicated this post on Help rubrique. Could moderators delete this empty post ?

  • saih_tam saih_tam modified a comment on discussion Script Showcase

  • saih_tam saih_tam modified a comment on discussion Script Showcase

    I duplicated this post on Help rubrique. Could moderators delete this empty post ?

  • saih_tam saih_tam modified a comment on discussion Help

    Exemple1 before modification : [song] artist = Erasure name = 04B.103.8e Always (2009 Remix) album = Pop! Remixed delay = 3050 diff_guitar = -1 diff_bass = -1 diff_guitar_coop = -1 diff_rhythm = -1 diff_vocals = -1 diff_keys = -1 diff_bass_real = -1 diff_guitar_real = -1 diff_dance = -1 diff_bass_real_22 = -1 diff_guitar_real_22 = -1 diff_vocals_harm = -1 sysex_high_hat_ctrl = True multiplier_note = 116 pro_drums = True charter = BobSchneeder45 background = imageWS.jpg last_play = 2022-01-16-22:36:05...

  • saih_tam saih_tam modified a comment on discussion Help

    Exemple1 before modification : [song] artist = Erasure name = 04B.103.8e Always (2009 Remix) album = Pop! Remixed delay = 3050 diff_guitar = -1 diff_bass = -1 diff_guitar_coop = -1 diff_rhythm = -1 diff_vocals = -1 diff_keys = -1 diff_bass_real = -1 diff_guitar_real = -1 diff_dance = -1 diff_bass_real_22 = -1 diff_guitar_real_22 = -1 diff_vocals_harm = -1 sysex_high_hat_ctrl = True multiplier_note = 116 pro_drums = True charter = BobSchneeder45 background = imageWS.jpg last_play = 2022-01-16-22:36:05...

  • saih_tam saih_tam modified a comment on discussion Help

    Exemple1 before modification : [song] artist = Erasure name = 04B.103.8e Always (2009 Remix) album = Pop! Remixed delay = 3050 diff_guitar = -1 diff_bass = -1 diff_guitar_coop = -1 diff_rhythm = -1 diff_vocals = -1 diff_keys = -1 diff_bass_real = -1 diff_guitar_real = -1 diff_dance = -1 diff_bass_real_22 = -1 diff_guitar_real_22 = -1 diff_vocals_harm = -1 sysex_high_hat_ctrl = True multiplier_note = 116 pro_drums = True charter = BobSchneeder45 background = imageWS.jpg last_play = 2022-01-16-22:36:05...

  • saih_tam saih_tam posted a comment on discussion Help

    Exemple1 before modification : [song] artist = Erasure name = 04B.103.8e Always (2009 Remix) album = Pop! Remixed delay = 3050 diff_guitar = -1 diff_bass = -1 diff_guitar_coop = -1 diff_rhythm = -1 diff_vocals = -1 diff_keys = -1 diff_bass_real = -1 diff_guitar_real = -1 diff_dance = -1 diff_bass_real_22 = -1 diff_guitar_real_22 = -1 diff_vocals_harm = -1 sysex_high_hat_ctrl = True multiplier_note = 116 pro_drums = True charter = BobSchneeder45 background = imageWS.jpg last_play = 2022-01-16-22:36:05...

  • saih_tam saih_tam posted a comment on discussion Help

    Algorithme rename : Start macro 'ctrl' + 'f'; ### open 'find window' 'n' 'a' 'm' 'e' ' ' '=' 'enter'; ### find("name =") If (find("name =") == true) : clic on 'close (cross) button'; ### close find window 'end' ### go to line's end with key '1' of numeric keypad 'shift' + 'home'; ### select all the line with key '7' of numeric keypad... 'shift' + 'left arrow'; ### ... and select the precedent line break 'ctrl' + 'x'; ### cut selection 'ctrl' + 'pg up'; ### go to precedent tab with key '9' of numeric...

  • saih_tam saih_tam modified a comment on discussion Script Showcase

    I duplicated this post on Help rubrique. Could moderators delete the wrong post ? Hello I'm sorry for my bad english. I used to use perso Notepad++ macros : I just record what I do using keyboard, keyboard shortcuts and the mouse only to clic on 'close (cross) button' of find window. It often helps me to save a lot of time in order to modify semi automatically a lot of files 'song.ini' (arround 5000). Unfortunatly, I’m stuck on the impossibility of using basing conditional tests. I understood that...

  • saih_tam saih_tam posted a comment on discussion Help

    Hello I'm sorry for my bad english. I used to use perso Notepad++ macros : I just record what I do using keyboard, keyboard shortcuts and the mouse only to clic on 'close (cross) button' of find window. It often helps me to save a lot of time in order to modify semi automatically a lot of files 'song.ini' (arround 5000). Unfortunatly, I’m stuck on the impossibility of using basing conditional tests. I understood that PythonScript plugin in Notepad++ allow this conditionnal tests (and far more). I...

  • saih_tam saih_tam modified a comment on discussion Script Showcase

    Hello I'm sorry for my bad english. I used to use perso Notepad++ macros : I just record what I do using keyboard, keyboard shortcuts and the mouse only to clic on 'close (cross) button' of find window. It often helps me to save a lot of time in order to modify semi automatically a lot of files 'song.ini' (arround 5000). Unfortunatly, I’m stuck on the impossibility of using basing conditional tests. I understood that PythonScript plugin in Notepad++ allow this conditionnal tests (and far more). I...

  • saih_tam saih_tam posted a comment on discussion Script Showcase

    Hello I'm sorry for my bad english. I used to use perso Notepad++ macros : I just record what I do using keyboard, keyboard shortcuts and the mouse only to clic on 'close (cross) button' of find window. It often help me to save a lot of time in order to modify semi automatically a lot of files 'song.ini' (arround 5000). Unfortunatly, I’m stuck on the impossibility of using basing conditional tests. I understood that PythonScript plugin in Notepad++ allow this conditionnal tests (and far more). I...

  • Sasumner Sasumner posted a comment on discussion Help

    Try it this way: editor.replace('"duration":300', '"duration":315360000')

  • Robert Robert modified a comment on discussion Help

    Sorry about the double post

  • Robert Robert posted a comment on discussion Help

    I need to run this find / replace in a huge json file. editor.replace(""duration":300", ""duration":315360000") editor.replace(""duration":600", ""duration":315360000") editor.replace(""duration":900", ""duration":315360000") editor.replace(""duration":3600", ""duration":315360000") I get the following error im sure its the " s in the syntax SyntaxError: invalid syntax File "C:\Program Files\Notepad++\plugins\PythonScript\scripts\User\Mods.py", line 7 editor.replace(""duration":300", ""duration":315360000")...

  • Robert Robert posted a comment on discussion Help

    I need to run this find / replace in a huge json file. editor.replace(""duration":300", ""duration":315360000") editor.replace(""duration":600", ""duration":315360000") editor.replace(""duration":900", ""duration":315360000") editor.replace(""duration":3600", ""duration":315360000") I get the following error im sure its the " s in the syntax SyntaxError: invalid syntax File "C:\Program Files\Notepad++\plugins\PythonScript\scripts\User\Mods.py", line 7 editor.replace(""duration":300", ""duration":315360000")...

  • Sasumner Sasumner posted a comment on discussion Help

    In general there is not an absolute way to intercept command invocation via their keyboard shortcuts. However, this posting discusses ways of attempting it: https://community.notepad-plus-plus.org/topic/21158/way-to-disallow-copying-text/

  • V@no V@no modified a comment on discussion Help

    Because I want it's functionality when text is selected and don't want it, when nothing is selected. Basically I'd like to combine F3 and CTRL+F3 into one For now I'm satisfied with this method, but still would like to know if there is a way capture commands within the script.

  • V@no V@no posted a comment on discussion Help

    Because I want it's functionality when text is selected and don't want it, when nothing is selected. Basically I'd like to combine F3 and CTRL+F3 into one For now I'm satisfied with this method, but still would like to know if there is a way capture commands within the script.

  • Sasumner Sasumner posted a comment on discussion Help

    Why not just disable it in the Shortcut Mapper?

  • V@no V@no modified a comment on discussion Script Showcase

    This is a simple Python script that backup edited file before it's being overwritten on save. It recreates a directory structure of original file in the backup folder and appends modification date of the original file to the end of filename (not date of the backup, file modification date). i.e. file C:\blah\mycode.js will be backed up as D:\Backup\Notepad++\C\blah\mycode.js_20210928_221824.js Because it copies file before NPP saves new data into it, you always will have a copy of the original file....

  • V@no V@no modified a comment on discussion Help

    duplicate. please ignore.

  • V@no V@no posted a comment on discussion Help

    Is there a way intercept and cancel execution of a command when a hotkey is pressed? Specifically I'm trying to intercept when CTRL+F3 is pressed (which is select and find next command) so it would not select a word next to the cursor if no text is selected.

  • V@no V@no posted a comment on discussion Help

    Is there a way intercept and cancel execution of a command when a hotkey is pressed? Specifically I'm trying to intercept when CTRL+F3 is pressed (which is select and find next command) so it would not select a word next to the cursor if no text is selected.

  • V@no V@no modified a comment on discussion Script Showcase

    This is a simple Python script that backup edited file before it's being overwritten on save. It recreates a directory structure of original file in the backup folder and appends modification date of the original file to the end of filename (not date of the backup, file modification date). i.e. file C:\blah\mycode.js will be backed up as D:\Backup\Notepad++\C\blah\mycode.js_20210928_221824.js Because it copies file before NPP saves new data into it, you always will have a copy of the original file....

  • V@no V@no posted a comment on discussion Script Showcase

    This is a simple Python script that backup edited file before it's being overwritten on save. It recreates a directory structure of original file in the backup folder and appends modification date of the original file to the end of filename (not date of the backup, file modification date). i.e. file C:\blah\mycode.js will be backed up as D:\Backup\Notepad++\C\blah\mycode.js_20210928_221824.js Because it copies file before NPP saves new data into it, you always will have a copy of the original file....

  • Kracov B Kracov B posted a comment on discussion Help

    https://sourceforge.net/p/npppythonscript/discussion/1188886/thread/6a6fa076/ This is what my issue is. But that seems to be only for one confirmation box, and it's really old, and I don't understand the part about sendkeys

  • Sasumner Sasumner posted a comment on discussion Help

    I don't think I even really understand the question. Maybe best to post on the Community site with more detail about what you're doing.

  • Sasumner Sasumner posted a comment on discussion Help

    I don't think I even really understand the question. Maybe best to post on the Community site with more detail about what you're doing.

  • Sasumner Sasumner posted a comment on discussion Help

    I don't think I even really understand the question. Maybe best to post on the Community site with more detail about what you're doing.

  • Kracov B Kracov B posted a comment on discussion Help

    Do you know the solution?

  • Kracov B Kracov B posted a comment on discussion Help

    I didn't know it was possible to hide the boxes. PS doesn't have a lot of settings

  • Sasumner Sasumner posted a comment on discussion Help

    There are ways, but if you are just going to "auto confirm" a bunch of boxes, why show them?

  • Kracov B Kracov B posted a comment on discussion Help

    Is there a way to automatically confirm Enter on a script that sends multiple dialog confirmation boxes? I plan to add a lot more macros for the script, so pressing Enter too many times is tedious.

  • claudio C. claudio C. modified a comment on discussion Open Discussion

    hello, yes that's my post :-)

  • claudio C. claudio C. posted a comment on discussion Open Discussion

    hello, yes that's my post :-) Il 17.05.2021 13:50 Sasumner ha scritto: It appears there may be a problem with the special casing stuff in Pythonscript...see https://github.com/bruderstein/PythonScript/issues/199 [1] serach reg exp [2] Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/npppythonscript/discussion/1188885/ [3] To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/ [4] Con Tiscali Mobile Smart 30 4G hai minuti...

  • Sasumner Sasumner posted a comment on discussion Open Discussion

    It appears there may be a problem with the special casing stuff in Pythonscript...see https://github.com/bruderstein/PythonScript/issues/199

  • claudio C. claudio C. posted a comment on discussion Open Discussion

    Taking the addition of "r" for granted so that my backslashes are processed by the regex engine, the problem of uppercase to lowercase characters with "\ L" remains. I doubt the correct syntax to bring everything in lowercase associated with group # 3: (\L$3) Is this correct? Thanks

  • claudio C. claudio C. posted a comment on discussion Open Discussion

    hello, but the command editor.rereplace () unlike editor.replace () is not already addressed for the regex engine? if not what is the difference? thanks

  • Sasumner Sasumner posted a comment on discussion Open Discussion

    Probably you need to use "raw strings" so that your backslashes aren't consumed by Python's interpretation and not given to the regex engine. So, instead of: editor.rereplace("abc", "def") do: editor.rereplace(r"abc", r"def")

  • claudio C. claudio C. posted a comment on discussion Open Discussion

    hi all, I need to manipulate files looking for and modifying some tags, transforming capital letters where present into lowercase. For the search I used regular expressions. This regular expression works perfectly in the npp ++ search and replace command but does not work in a python script. The command in question is: editor.rereplace ("((\ /) *) ([a-zA-Z] +) ((\ d) +) "," $ 1 (\ L $ 3) $ 4 "). Suggestions? thanks

  • Christian M Christian M posted a comment on discussion Help

    Well for certain languages it's really hard to guess what character coding where used to represent the string in the menu. But just for giggles I challenged myself and tried, after failing a few times to infer from the menu what it was, and when I was about to give up, I had the idea to look up the raw translation in xml: https://github.com/notepad-plus-plus/notepad-plus-plus/tree/master/PowerEditor/installer/nativeLang My language is Japanese so the corresponding entries in the xml are: <Item menuId="encoding"...

  • Sasumner Sasumner posted a comment on discussion Help

    Regarding "English"...for whatever localization you're using, can't you just replace the strings with whatever are appropriate for the language, and have it work?

  • Christian M Christian M modified a comment on discussion Help

    That was it, to summarize: MENUCOMMAND.FORMAT_AS_UTF_8 -> to UTF8 without BOM MENUCOMMAND.FORMAT_CONV2_AS_UTF_8 -> to UTF8 without BOM MENUCOMMAND.FORMAT_CONV2_UTF_8 -> to UTF8 with BOM Thanks! Side note: notepad.runMenuCommand("Encoding", "Convert to UTF-8") will convert to UTF8 without BOM notepad.runMenuCommand("Encoding", "Convert to UTF-8-BOM") will convert with BOM But it only works when Notepad++ language is set to English

  • Christian M Christian M modified a comment on discussion Help

    That was it, to summarize: MENUCOMMAND.FORMAT_AS_UTF_8 -> to UTF8 without BOM MENUCOMMAND.FORMAT_CONV2_AS_UTF_8 -> to UTF8 without BOM MENUCOMMAND.FORMAT_CONV2_UTF_8 -> to UTF8 with BOM Thanks! Side note: notepad.runMenuCommand("Encoding", "Convert to UTF-8") will convert to UTF8 without BOM notepad.runMenuCommand("Encoding", "Convert to UTF-8-BOM") will convert with BOM But it only works when Notepad++ language is set to English

  • Christian M Christian M modified a comment on discussion Help

    That was almost it, after looking it up more it's actually: MENUCOMMAND.FORMAT_AS_UTF_8 -> to UTF8 without BOM MENUCOMMAND.FORMAT_CONV2_UTF_8 -> to UTF8 with BOM Thanks for pointing me to the right direction. Side note: notepad.runMenuCommand("Encoding", "Convert to UTF-8") will convert to UTF8 without BOM notepad.runMenuCommand("Encoding", "Convert to UTF-8-BOM") will convert with BOM But it only works when Notepad++ language is set to English

  • Christian M Christian M modified a comment on discussion Help

    I edited the post to be clearer, let me rephrase here as well: MENUCOMMAND.FORMAT_CONV2_AS_UTF_8 converts to UTF8 with BOM, I need the same to convert without BOM but it does not exists, this is a feature request. Side note: notepad.runMenuCommand("Encoding", "Convert to UTF-8") will convert to UTF8 without BOM notepad.runMenuCommand("Encoding", "Convert to UTF-8-BOM") will convert with BOM Unfortunately it only works when Notepad++ language is set to English (this is not my case)

  • Christian M Christian M posted a comment on discussion Help

    I edited the pose to be clearer MENUCOMMAND.FORMAT_CONV2_AS_UTF_8 converts to UTF8 with BOM, I need the same to convert without BOM but it does not exists, this is a feature request. Side note: notepad.runMenuCommand("Encoding", "Convert to UTF-8") will convert to UTF8 without BOM notepad.runMenuCommand("Encoding", "Convert to UTF-8-BOM") will convert with BOM Unfortunately it only works when Notepad++ language is set to English (this is not my case)

  • Christian M Christian M modified a comment on discussion Help

    When Notepad++ language is set to something other than English: notepad.runMenuCommand("Encoding", "Convert to UTF-8") Will not be found, well that's to be expected but it seems the enum: notepad.menuCommand(MENUCOMMAND.FORMAT_CONV2_UTF_8) Converts to UTF8 with BOM and I can't find a version without BOM. It be nice to have both enums to convert to UTF8 with and without BOM. I recently discovered this little plugin and I'm very excited to all the things I'm going to be able to automate from now on...

  • Sasumner Sasumner posted a comment on discussion Help

    Not 100% certain, but perhaps MENUCOMMAND.FORMAT_CONV2_AS_UTF_8

  • Christian M Christian M posted a comment on discussion Help

    When Notepad++ language is set to something other than English: notepad.runMenuCommand("Encoding", "Convert to UTF-8-BOM") Will not be found, well that's to be expected but it seems the enum: notepad.menuCommand(MENUCOMMAND.FORMAT_CONV2_UTF_8) Converts to UTF8-BOM and I can't seem to find a version without BOM. I recently discovered this little plugin and I'm very excited to all the things I'm going to be able to automate from now on ^^ Thank you so much.

  • Sasumner Sasumner posted a comment on discussion Help

    You probably have to go to Boost::Regex documentation to find out all the details of the regex syntax used. The $ isn't used by itself here. It is part of ${ 1 } which means the first capture group contents. In my testing of exactly what I provided, [I] becomes <i> so I can't reproduce what you're saying. You can get good N++/Pythonscript regex help by posting here: https://community.notepad-plus-plus.org/

  • 607 607 modified a comment on discussion Help

    Thank you! That works, although I'm not quite sure why, because I can't find \l or this use of $ in the documentation for Python's re class. Edit: I've been doing some experimenting and was able to use the capitalisation ignore elsewhere too. However, I noticed that the suggested replacement doesn't quite work: [I] becomes <I>. Would it not be possible to let it become <i> automatically? I was intending to use .lower(), but couldn't access the content of the match at all.

  • 607 607 modified a comment on discussion Help

    Thank you! That works, although I'm not quite sure why, because I can't find \l or this use of $ in the documentation for Python's re class. Edit: I've been doing some experimenting and was able to use the capitalisation ignore elsewhere too. However, I noticed that the suggested replacement doesn't quite work: [I] becomes <I>. Would it not be possible to let it become <i> automatically?

  • 607 607 posted a comment on discussion Help

    Thank you! That works, although I'm not quite sure why, because I can't find \l or this use of $ in the documentation for Python's re class.

  • Sasumner Sasumner posted a comment on discussion Help

    So this is not a Pythonscript question, but search for (?i)\[([a-z])\] and replace with <\l${1}>

  • 607 607 posted a comment on discussion Help

    Hello, I was expecting this to be one of the most used cases, but I haven't been able to find anyone else doing it or asking about it. I would like to replace text using that text. In this specific case, I would like to replace any letter surrounded with square brackets to a lowercased version of the same letter surrounded in triangle brackets (I'm converting BB markup to HTML). eg. replace [b] with <b> and [I] with <i>. I have tried for 40 minutes but without success, as I cannot obtain the match's...

  • RandomUser441 RandomUser441 posted a comment on discussion Help

    Hi Sasumner, I am for sure interested to stop a scripts, I hopped and it would be like this: 1- menu [pluggins> Python Script> Running Scripts] and have a list of running scripts, and each script would have Reload/Stop submenu entery. 2- Currently it is possible to add a button to Menu, and Toolbar to run a script, I think it would be amazing to be able to have a button to stop the script as well as starting it. If you are planning to implement this feature please let me know, and thank you very...

  • Hien Huynh Hien Huynh posted a comment on discussion Help

    Dear Experts, I am struggling with the problem as the following: I have a folder (named A) contains 20 subfolders. In each subfolder, there are about 5,000 .mht files that only text. The .mth files were edited and remain only text. In total, there are 100,000 *.mht files in folder A. I open each .hmt file and then I can easily save as a .txt file. However, it will take me.... years 😭😭😭 with that. ==> My idea is that I want to use "notepad.saveAs" function to help me out. However, I do not know how...

  • mazeckenrode mazeckenrode posted a comment on discussion Help

    Ok, thanks, I’ll try there.

  • Sasumner Sasumner posted a comment on discussion Help

    I'm pretty sure you'll get some good help if you post your question on the "Community" site. The spam protection wouldn't let me put the link here. Look on Notepad++'s "question mark" menu for "Community"

  • mazeckenrode mazeckenrode modified a comment on discussion Help

    New to Python Script (and Python itself) but been using Notepad++ for about 10 years now, and regular expressions (in mostly basic but occasionally semi-advanced ways) for about 4 years. I’ve recorded a few regex-replace macros in Notepad++, using the built-in macro record/play functionality, but as everybody here no doubt knows, they are absolute bears to understand and edit, so I looked for other options and thought I’d give Python Script a try. But I’m running into problems, even though I don’t...

  • mazeckenrode mazeckenrode posted a comment on discussion Help

    New to Python Script (and Python itself) but been using Notepad++ for about 10 years now, and regular expressions (in mostly basic but occasionally semi-advanced ways) for about 4 years. I’ve recorded a few regex-replace macros in Notepad++, using the built-in macro record/play functionality, but as everybody here no doubt knows, they are absolute bears to understand and edit, so I looked for other options and thought I’d give Python Script a try. But I’m running into problems, even though I don’t...

  • Christoph  Zolder Christoph Zolder posted a comment on discussion Help

    I am trying to automate an XSL Transformation function in the XML Tools plugin with the script I wrote. But I only get the popup window "XML Transformation settings" without an automatic filled in path to the .xsl file. Here is my code to open an XML file and open the XSL transform window: notepad.open('XmlFilePath‘) notepad.runMenuCommand('XML Tools'‚ 'XSL Transformation…') I can enter the XSL file manually notepad.saveAs('newXmlFilePath‘) notepad.close How can I pass in the .xsl path automatically...

1 >