View Full Version : run mel on exit
doppelganger 07-05-2003, 09:37 PM MEL question
I am new to MEL and trying my hand at a small script which backs up your scenes folder across several drives and I was wondering if there is a way to make this script run when maya exits. I know you can run scripts on startup but it makes more sense to backup at the end of the day.
Thanks in advance,
Scott Spencer
__________________
Scott Spencer
www.doppelgangerdesign.com
|
|
mark_wilkins
07-05-2003, 09:52 PM
well, you could always make a menu item or shelf button that called the "quit" command after doing whatever you wanted to do specially...
I don't know if there's a more direct way than that.
-- Mark
rokandic
07-06-2003, 08:52 AM
You could use scriptJob "quitApplication" event:
scriptJob -e "quitApplication" "runMyScript";
You can put that line into userSetup.mel so you don't have to run it every time manually (and you're sure you wanna run your backup scripts every time you exit Maya).
safakoner
12-31-2003, 01:11 PM
I use this
/************************************
File Edit For Maya 5
Author: Safak Oner (c) 2003
safak@safakoner.com
www.safakoner.com
Run Command = equinox_fedit;
***********************************/
global proc equinox_fedit()
{
file -ea -type "mayaBinary" "D:/edit.mb";
}
equinox_fedit();
//-- END OF SCRIPT
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
/********************************
File Edit Hold Maya 5
Author: Safak Oner (c) 2003
safak@safakoner.com
www.safakoner.com
Run Command = equinox_fhold;
******************************/
global proc equinox_fhold()
{
string $close = `confirmDialog -title " Equinox | File Hold !"
-message "Do you want to save current file\nand load last backup file ?\n"
-ma "center"
-button " Save and Hold " -defaultButton " Save and Hold "
-button "Cancel"
-cancelButton "No"
-dismissString "No"`;
if ( $close == " Save and Hold " )
{
file -s;
file -o "D:/edit.mb";
}
}
equinox_fhold();
//-- END OF SCRIPT
CGTalk Moderation
01-15-2006, 02:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.