using the command line switches, but not working
-
so doing some interesting work on npp proper. now i have a good pipeline for all my projects. but the issue is using a batch file to run npp based on extension, current folder, etc and i cant get the switches to work together. this is what works
“%np%” -settingsDir=“C:\Users\MyName\Roaming\Notepad++\batch” “%file%”but anytime i add this: “%np%” -openFoldersAsWorkspace %workspace%, it doesn’t matter where i put %file% or the other switches, it won’t work.
basically i want to combine settingsdir, workspace, titleadd and others. what is the correct pattern for this?
chatgpt said this should be the pattern, yet…
start “” “%np%” “%file%” %general_flags% %workspace_flags%, i tried moving file to after general but that didn’t work. -
-openFoldersAsWorkspaceworks just fine with-settingsDirand-titleAddand other similar options, in my experiements.But, as far as I can tell, once
-openFoldersAsWorkspaceis specified anywhere on the command line, all path arguments are treated under the rule, “if it’s a folder, put it in the FolderAsWorkspace panel, and don’t open any file-paths directly”.That seems like the intent, because I don’t think it was considered that
notepad++.exe myfile.txt -openFoldersAsWorkspace SomeDirectory\would be a normal use-case (ie, when adding the feature, didn’t think that you’d want to open a file from one location, plus a folder-as-workspace from another, in the same command-line)If you don’t have the
-multiInstargument, and if you don’t have the multi-instance preference set, then you could break it up into two calls ofnotepad++.exe"%np%" -settingsDir="..." -openFoldersAsWorkspace "%workspace%" "%np%" -settingsDir="..." "%file%"In that incantation, the oFAW has to come first, because of the known-and-never-solved issue that oFAW doesn’t work on an already-running instance of Notepad++.
… But since I seem to remember that you do have the multi-instance preference set, that’s not likely to work for you. In which case, until you do a feature request, and it was accepted and implemented and released, I don’t know that you’ll get exactly what you want.
I’ll update the manual to better explain current behavior with the oFAW option.