View Full Version : Use MaxScript to Hit Enter
chriskroll 08-24-2010, 08:40 PM I am trying to automate the use of a third party utility in Max. I need a way to fake pressing the enter key when a simple dialog box comes up. The focus is already set to the confirm button on the dialog, I just need to hit enter. Is there any way to do this?
|
|
denisT
08-24-2010, 09:52 PM
I am trying to automate the use of a third party utility in Max. I need a way to fake pressing the enter key when a simple dialog box comes up. The focus is already set to the confirm button on the dialog, I just need to hit enter. Is there any way to do this?
here is how to confirm "Reset UVs" for UVW Unwrap modifier.
http://forums.cgsociety.org/showpost.php?p=6555926&postcount=2
Just modify the code a bit (change dialog title and default button text)...
chriskroll
08-24-2010, 11:05 PM
Thanks DenisT. That got me closer, but still no cigar. It turns out that the dialog box that I am trying to get rid of is actually a querybox. Using UIAccessor.GetPopupDialogs() does not seem to return a handles for queryboxes.
denisT
08-25-2010, 12:02 AM
It turns out that the dialog box that I am trying to get rid of is actually a querybox. Using UIAccessor.GetPopupDialogs() does not seem to return a handles for queryboxes.
what does UIAccessor.GetPopupDialogs has to do with it? A query box is a window as any other.
In MXS help there's a good sample of using
DialogMonitorOPS. It catches any opened window. Does it catch the yours one?
I think the problem might lie with the fact that the querybox window is modal and from what I've seen maxscript code does not run when a modal window is open, but rather pauses script execution until the user closes the window.
denisT
08-25-2010, 02:17 PM
I think the problem might lie with the fact that the querybox window is modal and from what I've seen maxscript code does not run when a modal window is open, but rather pauses script execution until the user closes the window.
my sample code shows how to press button exactly of a modal dialog.
my sample code shows how to press button exactly of a modal dialog.
That's what I get for talking before checking. :blush:
chriskroll
08-25-2010, 04:53 PM
You are right DenisT. I didn't see the big picture right away. Got it to work now by using code analogous to yours.
Thanks!
CGTalk Moderation
08-25-2010, 04:53 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-2013, Jelsoft Enterprises Ltd.