[Closed] Pressing the max exit button
Hi guys,
I would like to script the pressing of the exit max button. I know about quitmax() but it has some limitations. I guess I need the UIaccessor, maybe someone (looks at Groningen :rolleyes: ) can put up some pointers…
Thanks,
-Johan
Winnipeg here – I did something I never do. I enabled the MacroRecorder and got this:
actionMan.executeAction 0 “40013” – File: Exit 3ds Max
Of course this does not deal with handling the save yes/no/cancel button, you might need some dialogops handling for that, but it DOES press the Exit 3ds Max. I assume clicking the Windows [X] button does the same (but does not emit MacroRecorder code), but I could be wrong.
Hahaha, the macro recorder, wo would have thought about that…
Yes maybe it’s suitale for my situation where I only want to change some max settings via script and not save the file itself… I could clear the dirty flag as well before this command and hope all settings stick!
I’m so happy right now, and will be even happier when it all works
-Johan
out of sheer morbid curiosity… what are the limitations to quitMax()? 😮
As for the dialog… see the recent thread with some skeleton code:
http://forums.cgsociety.org/showthread.php?t=686067
It’s a pretty basic introduction on usage of dialogMonitorOps and UIAccessor stuff for the most common task – detecting the dialog you want, and pressing the button you want.
Quitmax doesn’t save out to 3dsmax.ini and registry if you do changes in max.
Consider this code
fn doGamma =
(
IDisplayGamma.colorCorrectionMode = #gamma
displayGamma = 2.2
fileInGamma = 1.0
fileOutGamma = 2.2
iniFile = getMaxIniFile()
setIniSetting iniFile "Gamma" "CorrectColorPickerState" "1"
setIniSetting iniFile "Gamma" "CorrectMtlEditorState" "1"
)
doGamma()
--Uncomment next, to immediately quit max and see settings not set by
setIniSettings are not retained.
--quitMax #noPrompt
Change the values at will and run the script with quitmax uncommented, now fire up max again and check the settings… theire not there… that’s a bug… I use this to change settings on server machines, so hopefully Bobo’s solution is going to help me, otherwise I’ll try to use to UIAccessor stuff shudders
-Johan
oooh… that’s not a good bug to have, now is it? %)
Anyway… the UIAccessor stuff is easypeasy! I wonder if I should try writing a little “dialogOps” (credit to bobo for that name) wizard script… eyes things on his plate …sometime.
I guess it isn’t no… :hmm:
easypeasy hey… well I might just… no wait… I’m off to bed… way too late… are you in the same timezone as I am?
-Johan