I'm trying to link a piece of code on maya application quit using scriptJob. It works when you choose don't save or cancel in the maya save prompt window, but if you choose save and then save the file it does not work as expected. I'm using Maya 2019.3.
MGlobal::executeCommand("scriptJob -e \"quitApplication\" "MyCustomCommand\" -per;");
I'm trying to do this from a cpp plugin. But tried it from script editor as well.