Hi, I'm trying two methods to press the default buttons of the 'V-Ray warning' dialog but neither are working.
If I evaluate
uiAccessor.getWindowText (dialogMonitorOps.getWindowHandle())it returns
undefinedI know I can use this (But, that doesn't have a false switch):
setVRaySilentMode()It's just, I need to get this to work with other scripts I've been working on, not just the V-Ray warning dialog. I've not gotten this to work for a while now and I'm nearly sure that it's something to do with my system.
Here's the two methods I've tried:
/* METHOD 1 */
clearlistener()
dialogMonitorOps.unRegisterNotification id:#VrayButtonYes
fn DiaMonOps_CloseVray = (
local hwnd = dialogMonitorOps.getWindowHandle()
local hwndChild = UIAccessor.GetChildWindows hwnd
for i in hwndChild where uiAccessor.getWindowText i == "V-Ray warning" do
(
-- uiAccessor.pressButtonByName hwnd "&Yes"
uiAccessor.pressDefaultButton()
)
true
)
dialogMonitorOps.enabled = true
dialogMonitorOps.interactive = false
dialogMonitorOps.registerNotification DiaMonOps_CloseVray id:#VrayButtonYes
/* METHOD 2 */
clearlistener()
dialogMonitorOps.unRegisterNotification id:#VrayButtonYes
fn DiaMonOps_CloseVray = (
local hwnd = dialogMonitorOps.getWindowHandle()
if uiAccessor.getWindowText hwnd == "V-Ray warning" do
(
-- uiAccessor.pressButtonByName hwnd "&Yes"
uiAccessor.pressDefaultButton()
)
true
)
dialogMonitorOps.enabled = true
dialogMonitorOps.interactive = false
dialogMonitorOps.registerNotification DiaMonOps_CloseVray id:#VrayButtonYes
-- setVRaySilentMode()
By 3dwannab · 2017-07-18