• Login
Community
  • Login

How to open specific files in different folder where root folder might be varied. Open File in Solution is my temporary solution.

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
8 Posts 4 Posters 1.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.
  • L
    Louis Go
    last edited by Feb 3, 2020, 7:41 AM

    Notepad++ is decent for my paper working.
    I’d like to find a way for open specific files at the same time like the example below.

    Resource files are customized and organized in locale folders.
    I Need to open different files having same name in different locale folders.

    Eg:
    Open “FormString.xml” file in ENG, CHT, CHS folders.
    PS: File name would be varied. It will not always be “FormString.xml”.
    –project folder
    –ENG
    –FormString.xml
    –PopupString.xml
    –CHT
    –FormString.xml
    –PopupString.xml
    –CHS
    –FormString.xml
    –PopupString.xml

    So far I found “Open File in Solution” is near to my goal.
    However I need to switch project locations frequently in SolutionHub is a bit pain in the neck.

    The steps below is in a bit of a hassle.

    1. Open SolutionHub and change the folder
    2. Select the folder in folder dialog. ( Note you can’t pase path, need to clicking all the ways down. )
    3. Save connections.

    Is there a way to dynamically change Solution hub ofis connection folder location for searching?
    Or any other solution is appreciated.

    1 Reply Last reply Reply Quote 0
    • P
      PeterJones
      last edited by Feb 3, 2020, 1:58 PM

      Sorry, I know nothing about Solution Hub (hadn’t even heard of that plugin until just now).

      If I’ve understood what you want, you may want to look into sessions , which are “a set of files opened in Notepad++”: Save Session and Load Session functionality is built into Notepad++'s File menu. I have heard from others that if you have more than a couple sessions that you want to deal with, the Session Manager plugin (installable through the Plugins > Plugins Admin) is useful.

      L 1 Reply Last reply Feb 4, 2020, 9:24 AM Reply Quote 1
      • L
        Louis Go @PeterJones
        last edited by Feb 4, 2020, 9:24 AM

        @PeterJones
        As far as I know save sessions only save in absolute path and cannot fulfill my need above.

        Sorry for not describiing my question clearly.

        I want to open following files at the same time
        C:\solution1\ENG\File.xml
        C:\solution1\CHT\File.xml
        C:\solution1\CHS\File.xml

        Where “C:\solution1” could be “D:\solution2” and “File.xml” could be “Another.xml”
        ENG CHT and CHS folder are fixed in relative location.
        Both root path and file name could be varied and I can’t predict those names.

        A 1 Reply Last reply Feb 4, 2020, 12:53 PM Reply Quote 0
        • A
          Alan Kilborn @Louis Go
          last edited by Feb 4, 2020, 12:53 PM

          @Louis-Go

          It sounds to me like a scripting plugin is needed to solve this problem.

          1 Reply Last reply Reply Quote 0
          • G
            guy038
            last edited by guy038 Feb 4, 2020, 4:02 PM Feb 4, 2020, 3:58 PM

            Hello, @louis-go, @Peterjones, @alan-kilborn and All,

            Why not a very simple batch file, like below, with the comments inside ?

            @echo off
            
            if NOT %2!==! goto Proc
            
            echo.
            echo.
            echo     Syntax ( 2 PARAMETERS ) :
            echo.
            echo.
            echo         Test.bat (FIRST part of the PATH) (File_NAME)
            echo.
            echo.
            echo.
            echo     Open in NOTEPAD++, the 3 FILES in PARAMETER 2, present UNDER the folders
            echo.
            echo      'ENG', 'CHS' and 'CHT', which are located UNDER the path in PARAMETER 1
            echo.
            echo.
            echo.
            echo     REMARK : If any PARAMETER contains SPACE chars, SURROUND it with 2 "" chars
            echo.
            echo.
            
            goto :EOF
            
            
            :Proc
            
            REM "<Installation PATH>\notepad++.exe" -nosession %1\ENG\\%2 %1\CHT\\%2 %1\CHS\\%2
            
            
            • Delete, at the end, the command REM and replace the part <Installation PATH> with your full pathname to Notepad++.exe

            • Save the modifications

            Enjoy !

            Best Regards,

            guy038

            L 1 Reply Last reply Feb 5, 2020, 2:42 AM Reply Quote 3
            • L
              Louis Go @guy038
              last edited by Feb 5, 2020, 2:42 AM

              @guy038
              guy038 Thanks!
              It’s the simplest solution. I was digging in the wrong direction too deep.

              1 Reply Last reply Reply Quote 0
              • L
                Louis Go
                last edited by Louis Go Feb 5, 2020, 4:40 AM Feb 5, 2020, 4:39 AM

                This is my right click on a file solution.
                It comes up with @guy038 's suggestion.
                If anyone need to use it.

                1. Change the reg file location to where you put batch file.
                2. Change the batch file XXNotePadPPPath to your actual notepad++ path.
                3. Right click on any file will do the work.

                Batchfile

                setlocal
                
                FOR %%i IN (%1) DO (
                echo filedrive=%%~di
                echo set filepath=%%~pi
                echo filename=%%~ni
                echo fileextension=%%~xi
                
                set XXFilePath=%%~di%%~pi
                set XXFilename=%%~ni%%~xi
                )
                
                set XXRootPath=%XXFilePath%..\\..
                set XXEngPath=%XXRootPath%\\Common\\String_CncEngs\\%XXFilename%
                set XXChtPath=%XXRootPath%\\CHT\\String_CncEngs\\%XXFilename%
                set XXChsPath=%XXRootPath%\\CHS\\String_CncEngs\\%XXFilename%
                "C:\Program Files\Notepad++\notepad++.exe" -nosession %XXEngPath% %XXChtPath% %XXChsPath%
                endlocal
                

                While using a reg setting. This is tested and run on win10.

                Registry file

                setlocal
                set XXNotePadPPPath="C:\Program Files\Notepad++\notepad++.exe"
                
                FOR %%i IN (%1) DO (
                echo filedrive=%%~di
                echo set filepath=%%~pi
                echo filename=%%~ni
                echo fileextension=%%~xi
                
                set XXFilePath=%%~di%%~pi
                set XXFilename=%%~ni%%~xi
                )
                
                set XXRootPath=%XXFilePath%..\\..
                set XXEngPath=%XXRootPath%\\Common\\String_CncEngs\\%XXFilename%
                set XXChtPath=%XXRootPath%\\CHT\\String_CncEngs\\%XXFilename%
                set XXChsPath=%XXRootPath%\\CHS\\String_CncEngs\\%XXFilename%
                %XXNotePadppPath% -nosession %XXEngPath% %XXChtPath% %XXChsPath%
                endlocal
                
                1 Reply Last reply Reply Quote 3
                • A
                  Alan Kilborn
                  last edited by Feb 5, 2020, 12:45 PM

                  @Alan-Kilborn said in How to open specific files in different folder where root folder might be varied. Open File in Solution is my temporary solution.:

                  It sounds to me like a scripting plugin is needed to solve this problem.

                  Batch file scripting. The plugin-less scripting! :-)

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