Jump to content
Sign in to follow this  
Landshark

Automation Script Button Help

Recommended Posts

I am trying to automate the loading of a graphics profile in my Nvidia control panel, specifically to select dual output mode (monitor + HDTV). The first part of the script works well up to the point where a dialogue box pops up to confirm my desire to load the selected profile. I cannot, however, get the script to select "Yes".

In order to troubleshoot, I broke the script into two parts, getting to the box and selecting "Yes". When I manually get to the dialogue box, the "Select Yes" function that I have works. It does not work, however, if the box is arrived at through the efforts of my automation script. The box just goes away without executing the command.

Here's the Code and a screenshot with AutoIt Window Info.

NvidiaCtrPanel()

Sleep(250)

SelYes()

Func NvidiaCtrPanel() ; works as advertised

RUN("C:\Windows\System32\nvcplui.exe")

Sleep(4000)

Send("!p")

sleep(500)

Send("l")

Sleep(500)

Send("MonitorPlasma") ;name of profile I'm trying to load

sleep(500)

send("{Enter}")

Sleep(1000)

EndFunc

Func SelYes() ; inop if run after NvidiaCtrPanel().

WinActivate("nvdisps")

ControlClick("nvdisps", "&Yes", 6)

EndFunc

post-30279-1197754179_thumb.jpg

Also tried MouseMove() and MouseClick(), ControlCommand() and ControlSend() with no success. Thanks in advance for the help.

Share this post


Link to post
Share on other sites

You have

ControlClick("nvdisps", "&Yes", 6)

per help

ControlClick ( "title", "text", controlID [, button [, clicks [, x [, y ]]]] )

the "&Yes" is the button text ( i am sure/guessing ) not actual text on that GUI

also, be sure you have the control id "6" from Autoit Info Tool. its in the Autoit folder and in the Autoit start menu

8)

Share this post


Link to post
Share on other sites

One more troubleshooting item. When the script navigates to the "Yes" button and is then stopped, manual selection of the "Yes" button has the same effect as the second part of the script (closes the box but doesn't run anything). I think the problem is in the first function, not the second.

Edited by Landshark

Share this post


Link to post
Share on other sites

problem solved. Issue was that the program was not accepting text inputs to change the display settings. Had to double click on the value instead. Here's my final code in case anyone runs into the same issue.

RUN("C:\Windows\System32\nvcplui.exe")

WinWait("NVIDIA Control Panel")

Send("!p")

Send("l")

WinWait("Load Desktop Profile")

ControlClick("Load Desktop Profile", "FolderView", 1, "left", 2, 67, 52)

WinWaitActive("nvdisps")

ControlClick("nvdisps", "&Yes", 6)

WinWaitActive("Apply Changes")

ControlClick("Apply Changes", "&Yes", 1)

WinWaitActive("NVIDIA Control Panel")

WinClose("NVIDIA Control Panel")

Run("C:\Windows\ehome\ehshell.exe")

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...