Community
    • Login

    Running a macro on all open docs

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    macro
    4 Posts 2 Posters 6.6k 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.
    • Andy BayleyA
      Andy Bayley
      last edited by

      Hi
      Is there a way to run a macro on all open documents? Currently I have to open each document to run a macro which is a pain. I’ve tried multi-selecting the tabs but that doesn’t work.
      Thanks.

      1 Reply Last reply Reply Quote 0
      • Andy BayleyA
        Andy Bayley
        last edited by

        . . . or run a macro on all of the docs in a single folder . . . ?

        1 Reply Last reply Reply Quote 0
        • guy038G
          guy038
          last edited by

          Hello, Andy,

          I don’t think this is native feature of N++. But, I do agree, with you, that this feature could be very interesting !

          As a work-around, you could :

          • 1) Gather the contents of all your opened documents, in a new tab

          • 2) Run your macro, on this big file, ONLY

          • 3) Replace the original contents of each file, by each modified part : I know, quite tedious :-((


          The good news is that Claudia or Scott could build a Python script, or Dail with a Lua script, which would do all these steps, in one go :-)) At least, the steps 1 and 3, anyway !

          • We just need, in phase 1, to separate, in that big file, the contents of each individual file by inserting any header, with the name of the file( as, for instance, ======== sample.txt ========= ), followed by its contents

          • In phase 3, the script would replace all the contents of each individual file by the appropriate part ( known from the header ! ) of the complete file

          Best Regards,

          guy038

          1 Reply Last reply Reply Quote 0
          • Andy BayleyA
            Andy Bayley
            last edited by

            Thanks for the reply! The individual files are XML order files and have lines which include the number of orders in that particular file. Merging them all into one wouldn’t be ideal without being able to extract them all after - possibly using a custom header as you mention. Ideally, the files also need to retain their filenames.

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