• Login
Community
  • Login

Add files from document list to Project

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
4 Posts 2 Posters 402 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.
  • R
    Rodrigo Santos
    last edited by Dec 2, 2022, 7:21 PM

    I see that you can open files in the Project tab to add them, but I was wondering if there’s a way to take a large number of already opened files from different folders in the document list and add them to a project without having to go back and re-open them in the project tab.

    A 1 Reply Last reply Dec 2, 2022, 7:58 PM Reply Quote 1
    • A
      Alan Kilborn @Rodrigo Santos
      last edited by Dec 2, 2022, 7:58 PM

      @Rodrigo-Santos

      I don’t believe so, at least in the sense of “wow, it’s easy and here’s how”.

      But, a project workspace is just a file, containing textual links to other files. You could manually build such a file.

      I guess it depends how many files you’d want to do this for, to see if it is worth it to take the manual approach, over the “really manual” approach of adding one file at a time, in the existing UI.

      A 1 Reply Last reply Dec 2, 2022, 8:15 PM Reply Quote 0
      • A
        Alan Kilborn @Alan Kilborn
        last edited by Dec 2, 2022, 8:15 PM

        As an example, a project lives in a .workspace file, so you might create a new file and name it MyWorkspace.workspace.

        Then you could put the following inside:

        <NotepadPlus>
            <Project name="proj1_name">
                <File name="..." />
                <Folder name="folder1_name">
                    <File name="..." />
                    <Folder name="folder2_name">
                        <File name="..." />
                    </Folder>
                </Folder>
                <File name="..." />
            </Project>
            <Project name="proj2_name">
                <File name="..." />
                <File name="..." />
            </Project>
        </NotepadPlus>
        

        The ... are where you’d put the pathnames to files you’d want at that level in the project hierarchy.

        Of course you can change your proj1_name, etc., and your folder1_name, etc.

        Folders are entirely optional; if you wanted everything top-level then your workspace file structure would simplify to:

        <NotepadPlus>
            <Project name="proj1_name">
                <File name="..." />
                <File name="..." />
                <File name="..." />
                <File name="..." />
                <File name="..." />
            </Project>
            <Project name="proj2_name">
                <File name="..." />
                <File name="..." />
            </Project>
        </NotepadPlus>
        

        and if you have only 1 project it simplifies even further to:

        <NotepadPlus>
            <Project name="proj1_name">
                <File name="..." />
                <File name="..." />
                <File name="..." />
                <File name="..." />
                <File name="..." />
            </Project>
        </NotepadPlus>
        

        So, really you’d just fill in the ... for each file that you wanted as part of the project.

        An easy way to get textual pathames to all of your files currently open is:

        • Window menu, select Windows…
        • press Ctrl+a
        • right-click on the selected area and choose Copy Pathname(s)

        Do a paste wherever you are building up your .workspace file, and then move data around to replace the ... with real filenames.

        (If you are really slick, a single column-block copy and paste could do it for you.)

        1 Reply Last reply Reply Quote 0
        • R
          Rodrigo Santos
          last edited by Dec 2, 2022, 8:27 PM

          Thanks for the detailed response. You are right, it may just be easier to reopen them in the project itself.

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