Activity for Sasumner

  • 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.

  • Sasumner Sasumner posted a comment on ticket #2398

    This issue was found by a Notepad++ user and was mentioned tangentially in an issue here: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/13944#issuecomment-1665094241 Subsequently, a formal N++ dedicated to it was opened here: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/13969

  • 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.

  • 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

  • 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).

  • 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.

  • 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/

  • Sasumner Sasumner posted a comment on discussion Help

    Try it this way: 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/

  • Sasumner Sasumner posted a comment on discussion Help

    Why not just disable it in the Shortcut Mapper?

  • 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.

  • 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?

  • 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

  • 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")

  • 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?

  • Sasumner Sasumner posted a comment on discussion Help

    Not 100% certain, but perhaps MENUCOMMAND.FORMAT_CONV2_AS_UTF_8

  • 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/

  • 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}>

  • Sasumner Sasumner posted a comment on ticket #444

    For someone researching this, it was revived and fixed for release 4.3.1. See the History notes for more information.

  • 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"

  • Sasumner Sasumner posted a comment on discussion Help

    Right at the front, just like I said. I tried it with your data set and got the results you expected. editor.rereplace(r"(?s)(^F1 VA \d+ )(?=.*\1)", r"! \1") without the (?s) the . won't match end-of-line characters. With it, it will. That way you can still use the . and don't have to resort to the [\s\S] trick (although that works fine, too). Aside: When you use the .* pattern, you should always first consider using it as .*? so that it matches minimally.

  • Sasumner Sasumner modified a comment on discussion Help

    "single line flag"? "Pythonscript wants..." -> it's about what YOU want :-) I think I see what you are saying though. You could have left your original regex alone and just added (?s)to the front of it.

  • Sasumner Sasumner posted a comment on discussion Help

    "single line flag"? "Pythonscript wants..." -> it's about what YOU want :-) I think I see what you are saying though. You could have left your original regex alone and just added (?-s)to the front of it.

  • Sasumner Sasumner posted a comment on discussion Open Discussion

    Well, why not just use straight Python without Notepad++ to do manipulation on these files? That would fit better in a "batch" situation like you describe. Or would the Pythonscripts use the power of Notepad++ to do something to the text that it would be difficult to duplicate in straight Python?

  • Sasumner Sasumner posted a comment on discussion Open Discussion

    I don't think it is reasonably possible, but let me ask you WHY this is important to you? I'm an extensive Pythonscript user and have never wanted/needed to do that.

  • Sasumner Sasumner posted a comment on discussion Help

    I don't know, I don't use DSpellCheck. Maybe remove it if you don't use it either. Also, maybe it is an older version, try looking for newer version.

  • Sasumner Sasumner posted a comment on discussion Help

    I think your original script would have worked (or been close to working) if you had done: now = datetime.datetime.now() Perhaps why it didn't appear to do anything is you didn't have the console showing to see the errors.

  • Sasumner Sasumner posted a comment on discussion Help

    https://notepad-plus-plus.org/community/topic/17256/guide-how-to-install-the-pythonscript-plugin-on-notepad-7-6-3-7-6-4-and-above

  • Sasumner Sasumner posted a comment on discussion Help

    There's advice in these places: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/5394 https://notepad-plus-plus.org/community/topic/17256/guide-how-to-install-the-pythonscript-plugin-on-notepad-7-6-3-7-6-4-and-above https://notepad-plus-plus.org/community/topic/16942/pythonscript-any-ready-pyscript-to-replace-one-huge-set-of-regex-phrases-with-others/11

  • Sasumner Sasumner posted a comment on discussion Help

    Here's an example: editor.setSelection(0,0) editor.addSelection(5,6) editor.addSelection(10,15)

  • Sasumner Sasumner posted a comment on discussion Help

    Have a look at the "threading" library Timer object.

  • Sasumner Sasumner posted a comment on discussion Open Discussion

    Since you know about the "community" it might be best to take your question there.

  • Sasumner Sasumner posted a comment on discussion Help

    The way plugins are handled has changed between 7.5.x and 7.6.x. Suggest you look here for more information: https://notepad-plus-plus.org/community/

  • Sasumner Sasumner posted a comment on discussion Help

    Okay, but what is a real use for it at all?

  • Sasumner Sasumner posted a comment on discussion Help

    For that script (of which I am the author), exactly the way it is provided as a sample, there is no good way to 'stop' it. It could be rearchitected a bit such that it is easily 'stoppable'. Of course, simply restarting Notepad++ and then not running that script again effectively stops it. If you are truly interested in dynamic start/stop of it, I could look into what code changes that would entail; let me know if interested.

  • Sasumner Sasumner posted a comment on discussion Help

    Hello Andre, I think Claudia has stopped using Notepad++ and thus no longer monitors the forum. Dave is fairly quiet as well. To respond to your question, what do you mean it "will not work"? What doesn't work about it? What newer version of Notepad++ and Pythonscript have youtried?

  • Sasumner Sasumner posted a comment on discussion Help

    So like if you create a new script and put only this in it and try to run it you see nothing in the console?: console.write('hello\n')

  • Sasumner Sasumner posted a comment on discussion Help

    I tried posting some code here but it won't let me. This forum is kinda dead anyway. Why don't you repost your question here?: https://notepad-plus-plus.org/community

  • Sasumner Sasumner posted a comment on discussion Help

    Can you post a few lines of "before" and "after"? I tried your Find regex in N++, and it just did "odd things" to some text I created, so I think I must have a misunderstanding somewhere about what you are trying to achieve.

  • Sasumner Sasumner posted a comment on discussion Help

    I think you're in the wrong place to ask this question.

  • Sasumner Sasumner posted a comment on discussion Open Discussion

    That is odd; I've looked at that example before but didn't notice "number" in it. I would presume this would be a better way of writing it: return 'Y' + str(int(m.group(1)) + 1) The key point is that what you get out of the regex routines is a string, to add 1 to it you have to convert it to a number, and then to concatenate it to as string, it needs to be made back into a string.

  • Sasumner Sasumner posted a comment on discussion Help

    FWIW, it works correctly for me from a .py file...

  • Sasumner Sasumner posted a comment on discussion Help

    Always think of the non-script solution first because it is probably easier! :-)

  • Sasumner Sasumner posted a comment on discussion Help

    Search on this regular expression: ((\d+)\).+\R).+(\R) and Replace with this: \1Unused \2\3\3 If this isn't what you want then you are expressing your need poorly?

  • Sasumner Sasumner posted a comment on discussion Help

    From the description I don't know that I understand what you are trying to do, but is it perhaps something that a regular expression replace operation could do more easily than a Pythonscript?

  • Sasumner Sasumner posted a comment on discussion Help

    Hmmm...for the 'already running' question, I use: try/except NameError. Some things to think about, at least...

  • Sasumner Sasumner posted a comment on discussion Help

    So okay the set/getProperty technique could be useful for any document-specific need, but I'd be inclined to just do something like this for that kind of need: b[notepad.getCurrentFilename()] = 7 where again "b" is a dict in the global space

  • Sasumner Sasumner posted a comment on discussion Help

    Ah, now I see what the 42 meant; I simply thought it was the answer to "everything". Seriously, though, what I do, and maybe it is wrong, but it works, is: script test1.py: a=3 script test2.py: print 'a:', a run test1.py run test2.py console shows: a: 3 After running test1.py, "a" is in the global namespace, to be read out or updated by test2.py. So...why do I need the globals() technique or the set/getProperty technique?

  • Sasumner Sasumner posted a comment on discussion Help

    What do you mean by "42"?

  • Sasumner Sasumner posted a comment on discussion Help

    I forgot my "match_found" function from the previous post: def match_found(m): print m.span(0)

  • Sasumner Sasumner modified a comment on discussion Help

    Backward regular expression searches are problematic. The Notepad++ user interface prohibits them directly (when you change "Search Mode" to "Regular Expression", the "up" direction is cleared and disabled). Perhaps that is why this code produces output: editor.research('a', match_found, 0, 0, editor.getTextLength()) but this does not: editor.research('a', match_found, 0, editor.getTextLength(), 0) (assumes 'a' is in your document)

  • Sasumner Sasumner modified a comment on discussion Help

    Backward regular expression searches are problematic. The Notepad++ user interface prohibits them directly (when you change "Search Mode" to "Regular Expression", the "up" direction is cleared and disabled). Perhaps that is why one this code produces output: editor.research('a', match_found, 0, 0, editor.getTextLength()) but this does not: editor.research('a', match_found, 0, editor.getTextLength(), 0) (assumes 'a' is in your document)

  • Sasumner Sasumner modified a comment on discussion Help

    Backward regular expression searches are problematic. The Notepad++ user interface prohibits them directly (when you change "Search Mode" to "Regular Expression", the "up" direction is cleared and disabled). Perhaps that is why one branch of this code produces output: editor.research('a', match_found, 0, 0, editor.getTextLength()) but this does not: editor.research('a', match_found, 0, editor.getTextLength(), 0) (assumes 'a' is in your document)

  • Sasumner Sasumner posted a comment on discussion Help

    Backward regular expression searches are problematic. The Notepad++ user interface prohibits them directly (when you change "Search Mode" to "Regular Expression", the "up" direction is cleared and disabled). Perhaps that is why one branch of this code produces output: editor.research('a', match_found, 0, 0, editor.getTextLength()) but this does not: editor.research('a', match_found, 0, editor.getTextLength(), 0) (assumes 'a' is in your document)

  • Sasumner Sasumner posted a comment on discussion Help

    You could change to a regular-expression replacemement, and add a word-boundary assertion before and after your search term: editor.rereplace(r'\b' + s[0] + r'\b', s[1])

  • Sasumner Sasumner modified a comment on discussion Script Showcase

    When you use \ inside of a string you need to double it. Example: os.chdir('Y:\\dataFiles')

  • Sasumner Sasumner modified a comment on discussion Script Showcase

    When you use \ inside of a string you need to double it. Example: os.chdir('Y:\\dataFiles')

  • Sasumner Sasumner posted a comment on discussion Script Showcase

    When you use \ inside of a string you need to double it. Example: os.chdir('Y:\dataFiles')

  • Sasumner Sasumner posted a comment on discussion Script Showcase

    Nice work. There are some interesting ideas here. One "problem" I noticed, that makes complete sense in the framework of how Pythonscript works: If you leave the Tk window open and switch back to Notepad++ to continue editing, then you do something which invokes another Pythonscript, this action is disallowed because another Pythonscript (yours) is already running. Not sure how/if this can be worked around, but it is completely natural to want to leave a Tk window open (like a modeless dialog) while...

  • Sasumner Sasumner posted a comment on discussion Help

    An alternative solution to the problem of Window clipboard access from Notepad++'s...

  • Sasumner Sasumner posted a comment on discussion Help

    So you have a Pythonscript program that you want to install on another computer without...

  • Sasumner Sasumner posted a comment on discussion Help

    This appears to be a dead thread but I am now trying to get the win32clipboard technique...

  • Sasumner Sasumner posted a comment on discussion Help

    I'm not sure if it is different if you have the installed version of Notepad++ versus...

  • Sasumner Sasumner posted a comment on discussion Help

    I think you are likely correct. A search of the NPP source code yields that ALL_OPEN_FILES...

  • Sasumner Sasumner posted a comment on discussion Help

    You are pretty much in the right place (the right site) for reporting it. I don't...

  • Sasumner Sasumner posted a comment on discussion Open Discussion

    I guess at some point the API designer has to decide when to stop. Perhaps this is...

  • Sasumner Sasumner posted a comment on discussion Help

    I'm noticing the following behavior with NPP 6.8.3 and PS 1.08: given NL = number...

  • Sasumner Sasumner posted a comment on discussion Help

    Leo, I believe that if you want to use the maxCount argument of .rereplace(), you...

  • Sasumner Sasumner posted a comment on discussion Help

    DaveW, I guess I have egg all over my face. I tried my stuff with the latest version...

  • Sasumner Sasumner posted a comment on discussion Help

    DaveW, I guess I have egg all over my face. I tried my stuff with the latest version...

  • Sasumner Sasumner posted a comment on discussion Help

    DaveW, Thanks for taking the time to reply. 99% of me wants to withdraw the original...

  • Sasumner Sasumner posted a comment on discussion Help

    I have a pythonscript that can run a really long time (depending upon amount of data...

  • Sasumner Sasumner posted a comment on discussion Script Showcase

    Hello Bruno, I don't see the script as being attached; maybe it is just me?

  • Sasumner Sasumner modified a comment on discussion Help

    This appears to be a bug. However, I noticed that the rereplace function performs...

  • Sasumner Sasumner posted a comment on discussion Help

    This appears to be a bug. However, I noticed that the rereplace function performs...

  • Sasumner Sasumner posted a comment on discussion Help

    I'm definitely new to this Scintilla thing, but I'm wondering if someone knowledgeable...

  • Sasumner Sasumner posted a comment on discussion Script Showcase

    Nice! I don't know if I'll use it directly, but I learned some techniques from it...

  • Sasumner Sasumner posted a comment on discussion Help

    Jacob, I think you're missing the point. The "problem" is not in a main script, but...

  • Sasumner Sasumner posted a comment on discussion Help

    Say I create a new pythonscript file, a.py: from Npp import * from b import * console.write("I'm...

  • Sasumner Sasumner posted a comment on discussion Help

    Depending upon script complexity, I like to have debug info go to the console window...

  • Sasumner Sasumner posted a comment on discussion Help

    Wow. Super-simple once how things work is known! Thanks, Dave. I ended up still doing...

  • Sasumner Sasumner posted a comment on discussion Help

    I think I found a bug with editor.paste() myself, so I'm going to switch to the above...

  • Sasumner Sasumner posted a comment on discussion Script Showcase

    This seems to be a valid porting from the old pysearch() to the new research(): matches...

  • Sasumner Sasumner posted a comment on discussion 1. Open Discussion

    Note that I am NOT looking for a listing of NPP's default shortcut/key mapping!!...

  • Sasumner Sasumner posted a comment on discussion 1. Open Discussion

    How can I get a list of all the current shortcut/key mappings into a text file?

  • Sasumner Sasumner posted a comment on discussion 1. Open Discussion

    How can I get a textual list of all keyboard shortcuts? This seems like such a basic...

1