Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Batch file open, select all, copy

    Help wanted · · · – – – · · ·
    4
    5
    390
    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.
    • Adam Olp
      Adam Olp last edited by

      I’ve put some batch files together using python that collects specific information from the file in a specific directory then creates a text file based on that information. It then opens that text file (just changed the software it opens it with from notepad to notepad++) so I can view the info. The next step, which I currently do manually, is to hit “select all” and “copy” so I can then paste the info to a couple other locations. I would like to automate the “select all” and “copy” parts of this process via the command line (I know it doesn’t seem like much, but by automating every possible step in the process I have cut significant time off finishing the processes as well as taken away issues caused by human error). I am brand new to Notepad++ so I am hoping someone can assist me with this project. Thank you so much.

      Ekopalypse Alan Kilborn 2 Replies Last reply Reply Quote 0
      • Ekopalypse
        Ekopalypse @Adam Olp last edited by

        @Adam-Olp

        what do you mean by using python that collects specific information ?
        You are using a local python installation or pythonscript plugin fro npp?

        1 Reply Last reply Reply Quote 0
        • Alan Kilborn
          Alan Kilborn @Adam Olp last edited by

          @Adam-Olp

          I’d say forget the “via the command line” part.

          Record a 2-step macro to do ctrl+a and then ctrl+c?

          But I hardly think it worth it. You seemed to agree in your post.

          1 Reply Last reply Reply Quote 0
          • Steven Haymes
            Steven Haymes last edited by

            Adam,

            Install NppExec -> Open your Python script in Npp -> Execute ->

            cd “$(CURRENT_DIRECTORY)”
            C:\Python37\python.exe “$(FILE_NAME)”

            -> Select the output in the NppExec console -> Control C -> Done

            You may need to change the path above to where your Python install is located. If you do a lot of this, you can save the script to reuse in NppExec and it will appear under the Macro menu.

            Happy Pythoning 🐍

            Steve

            1 Reply Last reply Reply Quote 1
            • Steven Haymes
              Steven Haymes last edited by

              Oops, I meant to put:

              INPUTBOX “$(FILE_NAME): Enter arguments or none to continue.”
              cd “$(CURRENT_DIRECTORY)”
              C:\Python37\python.exe “$(FILE_NAME)” $(INPUT)

              which gives you the option to give Python some command line arguments.

              Steve

              1 Reply Last reply Reply Quote 1
              • First post
                Last post
              Copyright © 2014 NodeBB Forums | Contributors