Community
    • Login

    NppEventExec - can not open specified file or it is empty

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 251 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.
    • H
      HConBike
      last edited by

      Hello Friends,

      I’m trying to format some text on opened files automatically. This for I created a macro named “fold” (it basically finds some text and presses a shortcut to fold the section). Now I want to use NppEventExec to execute this macro whenever a *.sdol-file was opened. My settings looking like that:

      5c59ccea-0e9b-407d-af0a-77b2879d4e64-image.png

      When I opened a sdol-file, I get this message:

      NPP_MENUCOMMAND Makros/fold" "2490221703168" "C:\Users\me\Desktop\my_file.sdol"
      - can not open specified file or it is empty
      ================ READY ================
      

      Does somebody know, what that means and how to fix it?
      The thing is, the macro itself is working fine as well as th NppExec-Command when I use the NppExec-Plugin…

      dinkumoilD 1 Reply Last reply Reply Quote 0
      • dinkumoilD
        dinkumoil @HConBike
        last edited by

        @HConBike

        You can not execute NppExec script commands from an NppEventExec rule. You have to write a script in NppExec (use the dialog under (menu) Plugins -> NppExec -> Execute) and save it under a descriptive name from within that dialog. Then you can use that name in the NppExec command input field of the NppEventExec rule dialog.

        H 1 Reply Last reply Reply Quote 1
        • H
          HConBike @dinkumoil
          last edited by HConBike

          @dinkumoil Thanks! That works. Imo, the Expression “NppExec command” is a little misleading…

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