It took me a while to find this problem, and I'm pretty much at a loss on how to resolve it. I'm currently using Control, Check, , Button1, which works fine... on ONE computer. I found out the hard way that the number changes from computer to computer, for reasons that I can not figure out.
Is there any way to check this checkbox reliably (on any given computer) without using the ClassNN Control name, but perhaps by using the text of the checkbox?
Control, Check,, ButtonX, ; problem Topic is solved
Re: Control, Check,, ButtonX, ; problem
Never mind... using ControlGetText with the text of the control seems to have worked. Thanks anyway.
Re: Control, Check,, ButtonX, ; problem
I'm needing to come back to this thread because there's still something not right with Button (checkbox) selection between these two computers.
If I use ControlGetText on the Windows 10 machine to identify the control's ID, all works like it should. But, on my Windows 7 machine... well, I am having issues. I have had to set a delay for up to 11 seconds (it seems random) in order for ControlGetText to return anything, and failing to do so messes up everything subsequent to this value.
I have even had to implement a 'decision tree' before calling 'SetProjectSaveAs'.
So, I guess that I'm asking... should it have to have a delay in the script to be accurate? Side-stepping the delay, do I really need a 'decision tree' to preset the value of the button that needs to be clicked (which makes this less portable than I would prefer)? Or is there something that I am missing about ControlGetText that would prevent it from getting the control's identification right every time on every computer?
If I use ControlGetText on the Windows 10 machine to identify the control's ID, all works like it should. But, on my Windows 7 machine... well, I am having issues. I have had to set a delay for up to 11 seconds (it seems random) in order for ControlGetText to return anything, and failing to do so messes up everything subsequent to this value.
Code: Select all
SetProjectSaveAs(FullFilePath)
{
SetTitleMatchMode, 2
PostMsg(40022) ; This code correlates with File:Save As : 40022
WinWait, Save Project,,60
Sleep, 5000 ; <-- Should this be necessary (for as high as 11 seconds (11,000) in some test runs)?
ControlGetText, tButton, Create ; Enable the 'Create Sub-directory for Project' setting
;;MsgBox % "ControlGetText for Create subdirectory checkbox: " tButton
Control, Check, , %tButton% ; Enable Create subdirectory for project
return
}
Code: Select all
If (A_Username = "Shooter") {
global tButton := "Button1"
} Else if (A_Username = "TXShooter") {
global tButton := "Button2"
} Else {
MsgBox The current user isn't the owner of this script. Access is denied. Just kidding... but yeah, things be broken y'all. Call the dude that wrote this script.
ExitApp
}
Re: Control, Check,, ButtonX, ; problem Topic is solved
I guess that I will just have to add a 20 second delay. Thanks for all the help.
Who is online
Users browsing this forum: Araphen, CrowexBR, Google [Bot], mcd, rubeusmalfoy, ShatterCoder, spellegrnio1 and 82 guests