Community
    • Login

    Run an external program

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 345 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.
    • Thomas HoppeT
      Thomas Hoppe
      last edited by

      Hello to all of you!

      I use notepad++ on Windows 10 to write my interactive fiction using Inform6 and punyinform. This works fine, but it would be great to automate it a bit further. But up to now, I am not able to get it done.

      After writing my code I switch to my open editor window…

      C:\PunyInform\lib

      and start compiling it with

      inform6.exe explore.inf

      where explore.inf is the source code in notepad++. This produces explore.z5

      After that I start the interpreter Frotz with

      explore.z5

      No great effort, but could this be done with one click from notepad++ using macros or a run command?

      I would be really happy, if you have some tipps for me!

      Thomas

      PeterJonesP 1 Reply Last reply Reply Quote 0
      • PeterJonesP
        PeterJones @Thomas Hoppe
        last edited by

        @Thomas-Hoppe ,

        I would recommend the plugin NppExec for such a procedure, as it’s essentially a “batch scripting” language for Notepad++, with a Console for showing the results inside the Notepad++ window.

        For example, for building c code using the gcc compiler, I have saved a script in NppExec that runs:

        NPP_SAVE
        cd "$(CURRENT_DIRECTORY)"
        gcc -o "$(NAME_PART)" "$(FILE_NAME)"
        $(NAME_PART)
        

        This saves the active file, changes into that file’s directory, runs the gcc compiler on the file, and then runs the executable that’s generated.

        So you would just run your inform6.exe instead of gcc and then explore.z5 instead of $(NAME_PART)

        You can have NppExec add your favorite scripts into either the Macros menu, or the Plugins > NppExec menu (using Plugins > NppExec > Advanced Options and then restarting Notepad++). And then you can use Settings > Shortcut Mapper > Plugin Commands and filter for NppExec, so that you can then use Modify to add a keyboard shortcut to easily run that NppExec script.

        You can see some other options in our FAQ: Automating Noteapd++, but based on your description, I think this most-closely matches your description.

        Thomas HoppeT 1 Reply Last reply Reply Quote 3
        • Thomas HoppeT
          Thomas Hoppe @PeterJones
          last edited by

          @PeterJones Thank you very much, all works fine;=)

          Thomas

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