Menu

Need to run Python script in Notepad++ periodically without manual run

Help
Sundeep
2019-03-31
2019-03-31
  • Sundeep

    Sundeep - 2019-03-31

    HI All,

    I have got below script from the One of the discussions in this sourceforge and itis good for converting the files to ANSI formatany specific format. However i have to run this every one hour for a specfiic folder as lot of uncides files push to taht specific folder. Can someone help me if this can be run as Batch file without manual run from Notepad++ ( i want to run below script only). Please suggest

    import sys;
    from Npp import notepad

    filePathSrc="C:\Users\vnsan\Desktop\Unicode\" # Path to the folder with files to convert

    for root, dirs, files in os.walk(filePathSrc):
    for fn in files:
    if fn[-4:] == '.txt': # 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)

             notepad.runMenuCommand("Encoding", "Convert to ANSI")
             notepad.save()
             notepad.close()
    
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.