• Login
Community
  • Login

Batch file open, select all, copy

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
5 Posts 4 Posters 979 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.
  • A
    Adam Olp
    last edited by Sep 1, 2019, 5:24 AM

    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.

    E A 2 Replies Last reply Sep 1, 2019, 11:41 AM Reply Quote 0
    • E
      Ekopalypse @Adam Olp
      last edited by Sep 1, 2019, 11:41 AM

      @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
      • A
        Alan Kilborn @Adam Olp
        last edited by Sep 1, 2019, 12:56 PM

        @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
        • S
          Steven Haymes
          last edited by Sep 1, 2019, 11:47 PM

          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
          • S
            Steven Haymes
            last edited by Sep 2, 2019, 12:00 AM

            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
            4 out of 5
            • First post
              4/5
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors