How to open specific files in different folder where root folder might be varied. Open File in Solution is my temporary solution.
-
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.xmlSo 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.
- Open SolutionHub and change the folder
- Select the folder in folder dialog. ( Note you can’t pase path, need to clicking all the ways down. )
- Save connections.
Is there a way to dynamically change Solution hub ofis connection folder location for searching?
Or any other solution is appreciated. -
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.
-
@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.xmlWhere “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. -
It sounds to me like a scripting plugin is needed to solve this problem.
-
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
-
-
@guy038
guy038 Thanks!
It’s the simplest solution. I was digging in the wrong direction too deep. -
This is my right click on a file solution.
It comes up with @guy038 's suggestion.
If anyone need to use it.- Change the reg file location to where you put batch file.
- Change the batch file XXNotePadPPPath to your actual notepad++ path.
- 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
-
@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! :-)