• Login
Community
  • Login

Launching Lua

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
lua
6 Posts 3 Posters 1.1k 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.
  • J
    John Hearle
    last edited by Feb 28, 2023, 10:04 PM

    Okay so I have made a new Name.Lua file, and put the correct directory for Lua.exe in the launch command.
    I also tried clarifying cmd /c and /k.

    I can not get NPP to open CMD, and auto paste/run the code.

    It will open CMD and not paste anything, meaning every time I want to run I have to copy and paste the whole thing by hand.

    I even tried making a .bat file to open Lua.exe and did not work.

    I copied videos exactly, still nothing.
    I get error code 2: cannot find file specified, and it shows me both directories for Lua and CURRENT_FILE_PATH so I don’t know how it can’t find them.

    I am noob to NPP just trying to set it up.

    P 1 Reply Last reply Feb 28, 2023, 10:14 PM Reply Quote 0
    • P
      PeterJones @John Hearle
      last edited by PeterJones Mar 1, 2023, 2:32 PM Feb 28, 2023, 10:14 PM

      @John-Hearle ,

      I get error code 2: cannot find file specified, and it shows me both directories for Lua and CURRENT_FILE_PATH so I don’t know how it can’t find them.

      $(CURRENT_FILE_PATH) is not listed in the special run-command variables in the user manual .

      I can not get NPP to open CMD, and auto paste/run the code

      It does not “auto paste”. You have to give the Run… command an argument to tell it exactly what you want to run.

      Run > Run… > cmd /c "c:\path with spaces\to\lua.exe" "$(FULL_CURRENT_NAME)" should properly run the active file name using lua.exe (or use cmd /k if you want it to keep the cmd window open)

      If you could show some of the example Run lines you have tried, I might be able to further explain why those weren’t sufficient, if I haven’t already explained it to your satisfaction.

      —
      edit:

      See Also

      We have a FAQ on how to run the active file through a compiler (which works equally well for an interpreter; that’s how I have Notepad++ set up to run the perl programs that I write).

      –
      edit 2: FULL_CURRENT_NAME is wrong; see later post below for correction

      P 1 Reply Last reply Mar 1, 2023, 2:06 PM Reply Quote 0
      • J
        John Hearle
        last edited by Feb 28, 2023, 10:37 PM

        I already tried that, it just opens CMD and gives me C:Program files/Notepad++>

        with the > symbol on end but nothing more, or it closes instantly.

        P 1 Reply Last reply Feb 28, 2023, 11:05 PM Reply Quote 0
        • P
          PeterJones @John Hearle
          last edited by Feb 28, 2023, 11:05 PM

          @John-Hearle ,

          You need to give me something. Copy/paste the exact commands you are using; use Alt+PrintScreen to show the command window. Something.

          Because if you have a valid path to lua, if you use quotes the way I showed, and if the normal way to run a lua script from the command line is lua.exe scriptname.lua, then the example I showed should have worked.

          1 Reply Last reply Reply Quote 0
          • P
            PeterJones @PeterJones
            last edited by Mar 1, 2023, 2:06 PM

            @PeterJones said in Launching Lua:

            cmd /c "c:\path with spaces\to\lua.exe" "$(FULL_CURRENT_NAME)"

            Ugh. I meant cmd /c "c:\path with spaces\to\lua.exe" "$(FULL_CURRENT_PATH)" – don’t know how I got that wrong, since I’d provided the link to the full list of valid variables and everything. :-(

            A 1 Reply Last reply Mar 1, 2023, 2:27 PM Reply Quote 0
            • A
              Alan Kilborn @PeterJones
              last edited by Alan Kilborn Mar 1, 2023, 2:49 PM Mar 1, 2023, 2:27 PM

              @PeterJones said in Launching Lua:

              $(FULL_CURRENT_PATH)

              I never remember this kind of stuff, so…

              I have a Run menu command – saved as NPP $(XXX) vars echo (file info) – that gives me an example when I need it:

              cmd /c echo FULL_CURRENT_PATH=$(FULL_CURRENT_PATH) CURRENT_DIRECTORY=$(CURRENT_DIRECTORY) FILE_NAME=$(FILE_NAME) NAME_PART=$(NAME_PART) EXT_PART=$(EXT_PART) && pause

              Sample output:

              18606e33-597c-498d-bf1c-e0f62d2c08e9-image.png

              After running, I can copy the FULL_CURRENT_PATH – or whatever text – from the cmd window, so not only do I NOT have to remember the names, I never have to type them either.

              Later edit:

              However, I can’t actually echo the verbatim text $(FULL_CURRENT_PATH) to the cmd window, because Notepad++ will hijack that and replace it. This could be “fixed” (see https://github.com/notepad-plus-plus/notepad-plus-plus/issues/9567 ) but perhaps doubtful that it ever will be.

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