Some old tools are designed to work with an external text editor. I am stuck using a legacy tool that does this in the following way:
- Create a temporary file with the content to be edited.
- Launch the user specified application adding the path to the temporary file as an argument.
- Wait for the launched application to close (probably monitors the PID)
- Check to see if the temporary file has been updated using the Date Modified field and load in the updated data.
I have been trying to use this tool (which cannot be easily changed) with Notepad++. I have had some issues with this because the tool only monitors the temporary file until the application it launched closes. When a new instance of the Notepad++ process is launched the default behavior is to open the file in any already opened instance of Notepad++ as a tab and close the new process. This results in the tool thinking the editor was closed immediately and then missing any edits that actually take place.
I am able to work around this by forcing the Notepad++ to always launch in a new instance using the -multiInst command line argument. I would like to be able to open the temporary files as tabs as I am also using some Notepad++ plugins that work across tabs (but not across instances).
Has anyone got any ideas of a solution? It would be great if I could get Notepad++ to open a file as a tab but still have the launched process in memory while the file is still open. I guess this would be similar to the one process per tab model Chrome uses. I have also considered launching Notepad++ indirectly via a batch file or similar, but I don't know how I could detect when the tab/file was closed in Notepad++.