Run an external program
-
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
-
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 ofgcc
and thenexplore.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.
-
@PeterJones Thank you very much, all works fine;=)
Thomas