@Michael-Vincent Thanks, I’ve managed to make this work with my use case. In case anyone’s interested, this is roughly what I’m doing (AHK code):
fileOpen := false
^+b::
if not fileOpen {
fileOpen := true
FileCopy, Backup\Notepad++\config (PostIt).xml, %A_AppData%\Notepad++\config.xml, 1
FileCopy, Backup\Notepad++\NppExec (PostIt).ini, %A_AppData%\Notepad++\plugins\config\NppExec.ini, 1
Run, "C:\Program Files\Notepad++\notepad++.exe" "C:\Path\To\PostIt\File.txt"
} else {
fileOpen := false
FileCopy, Backup\Notepad++\config.xml, %A_AppData%\Notepad++\config.xml, 1
FileDelete, %A_AppData%\Notepad++\plugins\config\NppExec.ini
}
return
The config (PostIt).xml is the file with my PostIt NP++ configuration (i.e., no title bars, line numbers, etc.) and config.xml is my usual NP++ configuration. The NppExec (PostIt).ini file is the configuration file for the NppExec plugin, which launches a script on startup that contains the following:
NPP_CONSOLE 0
NPP_MENUCOMMAND "View\Post-It"
This now seems to work as I want it. Thank you both for the help.