Question regarding Callback & [NOTIFICATION.FILEOPENED]

  • Sascha Offe

    Sascha Offe - 2013-06-02

    Hi there,

    first of all, thanks for PythonScript, great plug-in!

    I've written a script that scans for ".LOG" at the beginning of a text file, and if it's found, appends a timestamp to the file. It works fine if I call the scipt manually and also if I put it directly in my custom

    But my plan was actually to use the callback feature, so that each opened file will be automatically checked -- but either I misunderstood the use of Callback or I'm missing something else.

    import datetime
    def updateLog():
    notepad.callback(updateLog, [NOTIFICATION.FILEOPENED])

    A test with "if" returns true, so the registration seems to work.
    I've also change the initialisation from LAZY to ATSTARTUP.
    But nothing happens when I open my test file, neither via double click nor File -> Open...

    - Notepad++ 6.3.2 (Unicode)
    - PythonScript 0.9.2

    Thanks in advance for your help!


    • Dave Brotherstone

      I'm not in a place to check at the moment, but I think your callback
      function needs an argument (just one called, for example "args").
      The console may show a better error message.

  • Sascha Offe

    Sascha Offe - 2013-08-18

    You were right, the argument was missing; thanks.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks