Suggestion: Option to Close All before Session Load
-
I think @Ekopalypse and I have some uncertainty about the logistics of what you are trying to do on your end, but that’s for you to figure out.
I’ll just add that the Explorer plugin stores its “favorites” data in a
Favorites.dat
file. Manipulating/placing that file might be key to what you’re wanting to do? -
@Alan-Kilborn Sounds possible. I’ll check it out. Thanks.
-
@Alan-Kilborn I tried it out, adding three sessions. Is the favorites.dat file created automatically? Do you know where it’s located? (I couldn’t find it.)
The way I’ve set up my remote class, my students download the course material which includes about a dozen session files onto their PC. For each class they run N++ and open the session file corresponding to that particular class. Then we work together remotely with that material.
-
Go to the Plugins menu and choose Open Plugins Folder.
In the (Microsoft) Explorer window that opens, open the Config folder that should be present.Favorites.dat
should be in there if you are using the Explorer plugin.Note that I’m just providing some additional info on what @Ekopalypse started. I haven’t tried Eko’s original advice:
the Explorer plugin has a Favorites feature and you can save sessions there that behave exactly the way you want.
to verify that it does indeed behave in the manner you desire.
Good luck.
-
@Dwayne-Roberts said in Suggestion: Option to Close All before Session Load:
For each class they run N++ and open the session file corresponding to that particular class.
If I understand correctly, they are starting Notepad++ from scratch every day? Then why not turn off Settings > Preferences > Backup > Remember Current Session for next launch? Every time Notepad++ gets opened, each student will have an empty set of files (ie, it will just have
new 1
), then File > Load Session… will open just that day’s files (new 1
disappears if it hasn’t been modified). -
… Or another idea, if they need the periodic backup (which requires remembering-session to be left on), then change the Notepad++ shortcut to include the
-nosession
argument, so when they launch from the shortcut at the beginning of the day, it doesn’t use yesterday’s session.… Or make a the shortcut point to a batch file which deletes
%AppData%\Notepad++\session.xml
before running notepad++.exe… Or set a Windows Task Scheduler task to delete the session file at logout (or at logon, or at 6am every day, or whatever’s appropriate)
… Or you could use an external Perl instance with Win32::Mechanize::NotepadPlusPlus installed, to run the script
use Win32::Mechanize::NotepadPlusPlus qw/:main/; notepad->closeAll(); notepad->menuCommand($NPPIDM{IDM_FILE_LOADSESSION});
… Or you could install one of the scripting Plugins, like PythonScript or LuaScript, using Plugins > Plugins Admin, and run a nearly-identical script to the above.
Either of those last two could be set up to place an entry in the Macro or Run menus, and then assign a keyboard shortcut using Settings > Shortcut Mapper. If you want to go down one of those routes, let us know which would be your preferred language, and we can help you through making the menu entry and creating the shortcut. But the process varies
edits: clarified a couple of things.
-
@Alan-Kilborn Curiously, even though I am using the Explorer plug-in, there’s no Favorites.dat file in the plugins (or in the plugins\Explorer) folder. Besides other folders such as APIs, Config, Explorer, NppExport, there’s a PluginManager.dll and an Explorer.dll. I did a fruitless Windows file search for Favorites.dat. I’m using N++ v7.8.6 (32-bit).
-
@PeterJones I can’t guarantee they’ll start N++ from scratch in between classes. They may in fact review the work we did together.
-
there’s no Favorites.dat file
Interesting. I presume you created some “test favorites” before looking for the file? Maybe restarting N++? Maybe it needs a reason to create the file before doing so.
PluginManager.dll
is obsolete and you shouldn’t be using it. Plugins Admin is the way to go now. -
@PeterJones My preference would be for the Close All to be executed only when a new session is loaded, and then only optionally (either by a setting or a prompt). I think, for now I’ll just try to remind them at the beginning of each class to Close All before loading the new session. Thanks for the suggestions!