Hello,
i programmed a script to check xml files.
As long as the language is set to English everything works fine, after switching to german nothing works. Also, the change in German menu items takes no effect. E.G. notepad.runMenuCommand("Zeilenoperationen", "Leerzeilen (auch mit Whitespace) löschen") instead of notepad.runMenuCommand("Line Operations", "Remove Empty Lines (Containing Blank characters)")
notepad.runPluginCommand("XML Tools", "Pretty Print (XML only)") works in german, i think because there is no german translation.
import os;
import sys;
filePathSrc="c:\Test"
for root, dirs, files in os.walk(filePathSrc):
for fn in files:
if fn[-4:] == '.xml':
notepad.open(root + "\" + fn)
notepad.runMenuCommand("Line Operations", "Remove Empty Lines (Containing Blank characters)")
notepad.runMenuCommand("Blank Operations", "Trim Trailing Space")
notepad.runPluginCommand("XML Tools", "Pretty Print (XML only)")
notepad.save()
notepad.close()
Does somebody know a special work around to solve this problem?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
May I ask you why you want to go this way?
Why not using a pure python script, without using npp at all, instead?
I guess this would be much faster and you have more control over it.
Cheers
Claudia
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hy Claudia,
thank you for your answer. in my case, this was the fastest way. I'am not so good in python.
So i have to find some hours in the next time to improve my phyton knowledge.
Thank you
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
i programmed a script to check xml files.
As long as the language is set to English everything works fine, after switching to german nothing works. Also, the change in German menu items takes no effect. E.G. notepad.runMenuCommand("Zeilenoperationen", "Leerzeilen (auch mit Whitespace) löschen") instead of notepad.runMenuCommand("Line Operations", "Remove Empty Lines (Containing Blank characters)")
notepad.runPluginCommand("XML Tools", "Pretty Print (XML only)") works in german, i think because there is no german translation.
import os;
import sys;
filePathSrc="c:\Test"
for root, dirs, files in os.walk(filePathSrc):
for fn in files:
if fn[-4:] == '.xml':
notepad.open(root + "\" + fn)
notepad.runMenuCommand("Line Operations", "Remove Empty Lines (Containing Blank characters)")
notepad.runMenuCommand("Blank Operations", "Trim Trailing Space")
notepad.runPluginCommand("XML Tools", "Pretty Print (XML only)")
notepad.save()
notepad.close()
Does somebody know a special work around to solve this problem?
May I ask you why you want to go this way?
Why not using a pure python script, without using npp at all, instead?
I guess this would be much faster and you have more control over it.
Cheers
Claudia
Hy Claudia,
thank you for your answer. in my case, this was the fastest way. I'am not so good in python.
So i have to find some hours in the next time to improve my phyton knowledge.
Thank you
Hi Mirko,
the easieast way to see if a menucommand or plugin command works is to use the console.
Plugins->Python Script->Show Console
Then put the command into it (copy it from nativlang.xml to get the proper spelling
but you need to remove the accelerator chars) and run it.
When it run successful it returns true, if it fails it returns false.
In regards to a pure python solution I would do somethig like
To test it you need to have a test1.xml, once you're fine with it comment/delete the line
and uncomment
Cheers
Claudia
Last edit: CFrank 2016-02-19