Community
    • Login

    How to run a job from Notepad++

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 4.3k 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.
    • Arthur GilmourA
      Arthur Gilmour
      last edited by

      For many years I have used ConText editor which allows me to prepare a command file for my program, save it and easily run my program on the command file, and view the various output files. I have managed to get the Run command to execute, but cannot see how to make it read my command file open in Notepad++. It runs using the Notepad++ Install directory as the working folder, which is not where my command file is saved. My program expects to find the name of the command file and optional arguments on the command file. Can I, and if so how can I, use Notepad++ in this way.

      Claudia FrankC 1 Reply Last reply Reply Quote 1
      • Claudia FrankC
        Claudia Frank @Arthur Gilmour
        last edited by Claudia Frank

        @Arthur-Gilmour

        not 100% sure I understood what you try to achieve.

        As you said, npp can run external programs using the run function from the run menu.
        In addition, notepad understands certain variables which do get automatically expanded
        by npp like $(CURRENT_DIRECTORY) or $(FULL_CURRENT_PATH) etc…

        Assuming, the file you currently editing is C:\whatever\command_file.txt you could put something like

        PROGRAM2EXECUTE $(FULL_CURRENT_PATH)
        

        to run function and it would automatically expand the variable to C:\whatever\command_file.txt

        But as you said, npp executes external prgorams with a working directory of its own install directory.

        Now if you want to do something like

        cd to_the_directory_of_the_current_editing_file
        PROGRAM2EXECUTE current_editing_file AND_SOME_ADDITIONAL_PARAMETERS

        you can still achieve this by using the run function and call a batch file which
        does this for you or by running cmd.exe with command concatenation like

        cmd /C cd $(CURRENT_DIRECTORY) && PROGRAM2EXECUTE $(FULL_CURRENT_PATH)
        

        but to be honest, I would start thinking about NppExec plugin

        Just in case you have installed a newer version of notepad++
        and plugin manager isn’t available under plugins menu, you can download it from here.
        The …uni.zip is for x86, the x64 … yes, for 64bit notepad++ version.
        Just download and extract it to the npp install folder.

        With NppExec you can provide everything within its Execute window and save different profiles.
        You can interact with npp, so that you can open files once the program has been finished like for example here

        cd D:\AddProgs\Microsoft SDKs\Windows\v6.1\Bin
        xsd /nologo $(FULL_CURRENT_PATH) /o:$(CURRENT_DIRECTORY)
        xsd /nologo $(CURRENT_DIRECTORY)\$(NAME_PART).xsd /c /l:VB /o:$(CURRENT_DIRECTORY)
        npp_open $(CURRENT_DIRECTORY)\$(NAME_PART).xsd 
        npp_open $(CURRENT_DIRECTORY)\$(NAME_PART).vb
        

        it would create a vb class module out of an existing xml and it can do many more things…

        I hope I could shed some light on this.

        Note, encasing the variables by double quotes is a good idea to avoid having
        the space_within_path_feature.

        Cheers
        Claudia

        1 Reply Last reply Reply Quote 4
        • Arthur GilmourA
          Arthur Gilmour
          last edited by

          Thanks Claudia,
          I have used nppexec and the command set
          cd $(FULL_CURRENT_PATH)
          <Echidna Program Path> -o $(NAME_PART)

          Now to see how convenient to turns out to be.

          Best wishes, Arthur

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