validate the dialog box automatically
I want to create an archive for each .max. I want to validate the dialog box automatically when I save.
I found "UIAccessor.PressDefaultButton ()" but I can not use it because my "max file archive" is pausing.
How to solve the problem? Sorry I'm starting =)
Thx
clearlistener() thePath = getSavePath()--get a path dialog to specify the path if thePath != undefined do--if the user did not cancel ( theFiles = getFiles (thePath+"\\*.max") --collect all max files in the dir. for f in theFiles do-- go through all of them ( loadMaxFile f--load the next file ----------------------------------------------------------- -- MAKE SOME SCRIPTED CHANGES TO THE SCENE HERE... ----------------------------------------------------------- max file archive UIAccessor.PressDefaultButton () -- actionMan.executeAction 0 "40085" -- File: Archive -- saveMaxFile f --save the file back to disk )--end f loop resetMaxFile #noPrompt --at the end, you can reset )--end if
Comments
Actually, I've already looked
Actually, I've already looked at the documentation but it's not easy. I tested 2 method, but I have the same result. A window appears "Dialog Monitor" he asks me "Close the Dialog?" answer "Yes" or "No". Am I on the right track? I do not understand very well
Method 1
Method 2
.
Thank you very much for your
Thank you very much for your code. It works very well. I just removed this:
I needed to have the same name as the .max scene
Could you explain to me please? I would like to try to understand the reasoning.
Thanks again :)
Therefore, for my batch zip:
.
just read the reference there's nothing complicated
Sorry, I badly expressed
Sorry, I badly expressed myself, I wanted you to explain your code, not "maxscript reference scene filename". File archive already use the scene name. That's good ;)
.
Well..
1. check if there's a window handle
2. get window data
3. check if window has appropriate title
4. iterate over window child controls
5. if child control is "Edit" then set archive filename and press Save
6. handle (or not) overwrite popup if directory already contains zip with such filename
7. unregister dialogmonitor
Thanks again
Thanks again
Check the DialogMonitorOPS topic in maxscript reference, they're designed to catch the dialog and if it matches the criteria you set, you can then press the default button.
Some of my scripts and MCGs :: 3ds Max SDK Intro for Scripters