The only thing to keep in mind that it won't run if Maya crashes. For that, you need to resort to the OS, or a cross-platform library like psutil.
On 24 April 2015 at 14:33, Fredrik Averpil <[email protected]> wrote: > Yes, I believe you're right. I managed to run a custom function on exit > using: > > cmds.scriptJob(e=['quitApplication', myFunction] ) > > > > On Thu, Apr 23, 2015 at 9:58 AM Mahmoodreza Aarabi <[email protected]> > wrote: > >> I think there is a ScriptJob for this. >> And i think this is discussed earlier in this group. >> >> On Thu, Apr 23, 2015 at 12:56 AM, Fredrik Averpil < >> [email protected]> wrote: >> >>> Does anyone know if it is possible to tell Maya to execute a function >>> when it exits? >>> >>> Regards, >>> Fredrik >>> >> -- >>> You received this message because you are subscribed to the Google >>> Groups "Python Programming for Autodesk Maya" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/python_inside_maya/CAD%3DwhWPWT4F8Lxvyb2jcK%2Bcs5u1dGVFLhzshFcsJuubOsC0qaA%40mail.gmail.com >>> <https://groups.google.com/d/msgid/python_inside_maya/CAD%3DwhWPWT4F8Lxvyb2jcK%2Bcs5u1dGVFLhzshFcsJuubOsC0qaA%40mail.gmail.com?utm_medium=email&utm_source=footer> >>> . >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> >> >> -- >> >> >> Bests, >> madoodia >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Python Programming for Autodesk Maya" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/python_inside_maya/CADvbQwKvRDqBRge8Parrkq1FydcrzO9fREe2B9-7Xqx8Emf6LA%40mail.gmail.com >> <https://groups.google.com/d/msgid/python_inside_maya/CADvbQwKvRDqBRge8Parrkq1FydcrzO9fREe2B9-7Xqx8Emf6LA%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > -- > You received this message because you are subscribed to the Google Groups > "Python Programming for Autodesk Maya" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/python_inside_maya/CAD%3DwhWMkws-H15BFZ1b57Y2Dd8RNypLgh30GoHpcdy4PvcjjHA%40mail.gmail.com > <https://groups.google.com/d/msgid/python_inside_maya/CAD%3DwhWMkws-H15BFZ1b57Y2Dd8RNypLgh30GoHpcdy4PvcjjHA%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- *Marcus Ottosson* [email protected] -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOA25GEYpFS3pRbn7AUC%2BTwMTJ8iLnZLJNK%2B37AmVVOMOg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
