How to schedule a python scripts in plugin manager?
-
Hello!
I created a python scripts in plugin manager, to handle file encoding.
I would like this script to be running repeatedly.Is there a way to achieve this?
Any help is appreciate!import os; import sys; from Npp import notepad filePathSrc=r"\\mxns.loc\shares\use1-data\Global-SFTP\SFTP\Stage\s_lesters\toMXNS\in_bound" # Path to the folder with files to convert console.write(filePathSrc + "\r\n") for root, dirs, files in os.walk(filePathSrc): for fn in files: if fn[-4:] == '.csv' or fn[-4:] == '.inc' or fn[-4:] == '.css' or fn[-4:] == '.js' or fn[-4:] == '.htm' or fn[-5:] == '.html': # Specify file types, taking care to change the fn[number] to correspond to length of the file's extension including the . notepad.open(root + "\\" + fn) console.write(root + "\\" + fn + "\r\n") notepad.runMenuCommand("Encoding", "Convert to ANSI") notepad.save() notepad.close()
-
What does “repeated” mean in this case?
Time-based, event-based, or other triggers?
Because if you are the only one editing these files it
might be better to run the script once and then use
another script that ensures that files from that location
use Ansi encoding.