PDA

View Full Version : Pressing the max exit button


JHN
10-21-2008, 12:42 PM
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

Bobo
10-21-2008, 12:55 PM
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.

JHN
10-21-2008, 01:56 PM
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

ZeBoxx2
10-21-2008, 09:14 PM
out of sheer morbid curiosity.. what are the limitations to quitMax()? :o

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.

JHN
10-21-2008, 10:23 PM
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

ZeBoxx2
10-21-2008, 10:50 PM
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.

JHN
10-21-2008, 11:19 PM
oooh... that's not a good bug to have, now is it? %)

I guess it isn't no... :hmm:

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.

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

CGTalk Moderation
10-21-2008, 11:19 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.