Yeah, my intuition would also say that your notepad.saveAs() should work, but it must still require that the hosts file be unlocked. Have you tried saveAsCopy()? I'm thinking that notepad.saveAsCopy("D:\t.txt") should do what you are expecting... Notepad.saveAs(filename) Save the current file as the specified filename Notepad.saveAsCopy(filename) Save the current file as the specified filename, but don’t change the filename for the buffer in Notepad++
I believe some anti-virus softwares will prevent changes to the host file. A windows service might also have a lock on it. Here are some things to try: - Right click the file and make sure its not Read-Only - Run N++ as administrator and try to edit it again - Reboot into safe mode and edit it - Save it as .changed and use the windows console or python library to copy the file to hosts - Find which process is using the file and kill it.
Hi, I'm having trouble compiling PythonScript from source using VS2017, so that I can correct issue #22 (notepad.getFiles() returns incorrect results). I keep getting compiler errors like: utf8iterator.h(28): error C2039: 're_detail': is not a member of 'boost' The offending line: typedef boost::re_detail::lcid_type locale_type; I've followed Brotherstone's instructions here. Has anyone else encountered this error before? Or can someone please offer some advice?
Hi Veekshita, If I understand you correctly, you want to run some automated process and when that is finished, run your N++ script to change the UTF-8 encoding for all files in the folder specified? I'd agree with Claudia that you might try launching the automated process from within you N++ script and then waiting for it to finish before proceeding with the conversion. However, sometimes that is just not possible... A second solution that might work for you invloves the ActiveX plugin. It will create...
Hi Dan, I encountered a little problem when trying to implement my suggestion, i.e. for a single word 's[0].isupper() and s[1:].islower() == s.title()'. So, when cycling through case changes for a single word, it would get stuck in the the sentance/title case and never proceeds to the upper case. I was able to work around this by changing the order of your functable. Here is the updated code. #Title: MS Word-style case change (Shift+F3 feature): # change the case of selected text from upper to lower...
Hi Dan, I encountered a little problem when trying to implement my suggestion, i.e. for a single word 's[0].isupper() and s[1:].islower() == s.title()'. So, when cycling through case changes for a single word, it would get stuck in the the sentance/title case and never proceeds to the upper case. I was able to work around this by changing the order of your functable. Here is the updated code. #Title: MS Word-style case change (Shift+F3 feature): # change the case of selected text from upper to lower...
Yep. Take the string 'two words' for example. When the cursor is "on" whitespace it could be to the left of the space ('two| ') or to the right of it (' |words'). Eiher way, wordStartPosition() and wordEndPosition() return the begining and end of the "word" the cursor is touching. If you place the cursor between two spaces (e.g. 'two | spaces') then wordStartPosition() == wordEndPosition() == getCurrentPos().
Nice work Dan! I just have one suggestion to make it act more like Word... Instead of displaying a messageBox if no selection is made, you could automatically select the current word and apply the modification to that. # Select the "word" at current cursor position pos = editor.getCurrentPos() begin = editor.wordStartPosition(pos,True) end = editor.wordEndPosition(pos,True) editor.setSel(start, end) # Transform word case text = editor.getSelText() text = alter(text) editor.replaceSel(text)