Detecting if check box is checked Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
SilverGaiden
Posts: 12
Joined: 08 Jun 2018, 01:39

Detecting if check box is checked

13 Jun 2018, 19:19

Hello!

Again thank you in advance for all the help.

I seem to be having some trouble with check boxes. I know that the state is detected after being checked, but when the check box is checked (Private=1) THEN you change the dropdown menu to firefox or chrome, it will not bring up the private/incognito window.

If you change the drop down menu first, and THEN check the box second, it will pull up the private/incognito window.

Any help with why this is? or if there is a different way to perform this?

Code: [Select all] [Expand] [Download] (Browse.ahk)GeSHi © Codebox Plus

SilverGaiden
Posts: 12
Joined: 08 Jun 2018, 01:39

Re: Detecting if check box is checked

13 Jun 2018, 19:20

Corrected Grammar with last edit
Hellbent
Posts: 124
Joined: 23 Sep 2017, 13:34

Re: Detecting if check box is checked

14 Jun 2018, 01:24

When you add a control, even though you have told it what should or not be selected, the associated variables don't have a clue about what those values are. You have two options if you want to keep using "GuiControlGet".

1. Create your variables above your gui and give them a starting value
ie.
SelectedBrowser:= "Defalut Browser"

2. After you have added all your controls but before the return, do a gui, submit to make sure the values are in the associated variables.

ie.
Gui,show
Gui,submit,nohide
return

**Edit: Also, you have this
PassthroughPrivate="-incognito"
What you want is:
PassthroughPrivate:="-incognito"
or
PassthroughPrivate=-incognito
SilverGaiden
Posts: 12
Joined: 08 Jun 2018, 01:39

Re: Detecting if check box is checked

14 Jun 2018, 13:28

Hellbent wrote:When you add a control, even though you have told it what should or not be selected, the associated variables don't have a clue about what those values are. You have two options if you want to keep using "GuiControlGet".

1. Create your variables above your gui and give them a starting value
ie.
SelectedBrowser:= "Defalut Browser"

2. After you have added all your controls but before the return, do a gui, submit to make sure the values are in the associated variables.

ie.
Gui,show
Gui,submit,nohide
return


Thank you Hellbent, but I think I am a little lost on that. I changed it and tried to position along the top but it either doesn't show or it doesn't change anything. Sory I am a nub when it comes to this. I did change the GuiControlGet to "Gui, Submit, Nohide". I don't know which is better and I am open to revamp my entire code to do it properly and efficiently.


Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus




Hellbent wrote:**Edit: Also, you have this
PassthroughPrivate="-incognito"
What you want is:
PassthroughPrivate:="-incognito"
or
PassthroughPrivate=-incognito


Thank you on the code help! that explains a few things I was encountering in the past.


Would you be able to provide a coding example? I'm just not understanding how to structure it. (like I said earlier, I'll scrap the whole thing to code it properly and efficiently, I like to learn)

THANK YOU!
Hellbent
Posts: 124
Joined: 23 Sep 2017, 13:34

Re: Detecting if check box is checked  Topic is solved

14 Jun 2018, 13:58

Here is what I am talking about in regards to the associated variable.

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

SilverGaiden
Posts: 12
Joined: 08 Jun 2018, 01:39

Re: Detecting if check box is checked

14 Jun 2018, 15:30

Sweet that explains the GuiControlGet situation

From what I gather then, gui submit causes it to actually recognize it's own variable the moment it's selected, no matter the position in the script. I changed it back to Gui, Submit, NoHide.

If I understand this correctly, the SelectedBrowser variable, is not submitting the Private variable. How do I get the drop-down menu to submit the Private variable as well?
SilverGaiden
Posts: 12
Joined: 08 Jun 2018, 01:39

Re: Detecting if check box is checked

14 Jun 2018, 18:21

WOOT WOOT! I FIGURED IT OUT!

Thank you Hellbent!!! you gave me what I needed!

I changed the group on the checkbox to gBrowserType and then just placed the privacy check in the same group.

:dance: :dance: :dance: :dance: :dance:

Code: [Select all] [Expand] [Download] (Browse2.ahk)GeSHi © Codebox Plus


Return to “Ask For Help”

Who is online

Users browsing this forum: swagfag and 36 guests