• Login
Community
  • Login

NppExec: npp command resulting in error message in scripts

Scheduled Pinned Locked Moved Notepad++ & Plugin Development
5 Posts 3 Posters 539 Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D
    Domi M
    last edited by Mar 10, 2022, 8:13 AM

    If I run “NPP_SAVE” in a script, an error message is generated (file is saved, anyway). “NPP_SAVE” directly typed in the console is working correctly.
    8e6d7f1a-6294-438c-b519-1cff8b11546b-grafik.png

    Does anyone know, how to resolve this? (maybe a missing setting or sth. else?)

    I’m running NPP v. 7.8.9 64-bit on Windows 10.

    E 1 Reply Last reply Mar 10, 2022, 9:34 AM Reply Quote 0
    • E
      Ekopalypse @Domi M
      last edited by Mar 10, 2022, 9:34 AM

      @domi-m

      I assume something after NPP_SAVE is the cause.
      I would insert echo statements to see where exactly it is failing.
      It must have something to do with the " ".

      V 1 Reply Last reply Mar 10, 2022, 1:42 PM Reply Quote 3
      • V
        Vitalii Dovgan @Ekopalypse
        last edited by Mar 10, 2022, 1:42 PM

        While processing commands, NppExec removes the leading and trailing spaces ( ’ ’ also known as ‘\x20’ ) and tabs ( ‘\t’ also known as ‘\x09’ ).
        In this situation, the next line after NPP_SAVE most likely contains some whitespace-like character that looks like a space but has a character code different from 0x20 and 0x09.

        V D 2 Replies Last reply Mar 10, 2022, 1:50 PM Reply Quote 4
        • V
          Vitalii Dovgan @Vitalii Dovgan
          last edited by Mar 10, 2022, 1:50 PM

          This can be investigated locally by adding npe_debug local 1 right above the line with NPP_SAVE. It will print all the details of how NppExec executes the given commands and it will be possible to see the command item responsible for the “empty” command.

          1 Reply Last reply Reply Quote 5
          • D
            Domi M @Vitalii Dovgan
            last edited by Mar 10, 2022, 3:06 PM

            @vitalii-dovgan Yes, that was the issue, a whitespace-like character in the next line.

            Thank you!

            1 Reply Last reply Reply Quote 3
            4 out of 5
            • First post
              4/5
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors