Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate

User/Pass Authentication Pop Up


  • Please log in to reply
9 replies to this topic
mrdata
  • Guests
  • Last active:
  • Joined: --
I was just wondering if there was any better way to enter your user name and password when not in a log-in screen. I know COM is the best way to fill in fields on a webpage, but what about when the pop up isn't actually on the page? As in, the page is password protected, and while it's loading it stops, and pops up a little box asking for your user/pass. I don't exactly know how to explain it. I know that you can always just use:
send,user{tab}pass{enter},
but I was hoping for a better way. Is there a better way? Can COM do it?

Additionally, is there a good way to detect if this box appears at all? Because that would be extremely helpful

Thanks in advance!

Carcophan
  • Members
  • 1578 posts
  • Last active: Nov 27 2013 06:46 PM
  • Joined: 24 Dec 2008
get the name of the pop-up, and winwaitactive or gettitlematch.

Once the pop up is active, the script can send the commands to it.

mrdata
  • Guests
  • Last active:
  • Joined: --
uh, will that work? When I say pop up, it's not actually a new window, it doesn't show up in the taskbar/task manager to my knowledge, it's just a part of Fierfox/IE, asking you for your user/pass?

Carcophan
  • Members
  • 1578 posts
  • Last active: Nov 27 2013 06:46 PM
  • Joined: 24 Dec 2008
So use window spy, provided with AHK. Click on the password 'window/pop-up' incase it does have its own title.

No sense in reinventing the wheel, incase it is just hidden or something.

And yea, COM would be able to see/read the box the same way, you could use the DOM viewer the same way you would use the window spy tool. COM/DOM is still too new for me though, to write something for you using that tech.

HotKeyIt
  • Moderators
  • 7439 posts
  • Last active: Jun 22 2016 09:14 PM
  • Joined: 18 Jun 2008

uh, will that work? When I say pop up, it's not actually a new window, it doesn't show up in the taskbar/task manager to my knowledge, it's just a part of Fierfox/IE, asking you for your user/pass?

Run Au3_Spy.exe and check if you can see ClassNN of control, like Edit1 or Button1
If so, you can use ControlSetText and ControlClick commands.

mrdata
  • Guests
  • Last active:
  • Joined: --
Ok so WindowSpy gives me the following info:

>>>>>>>>>>( Window Title & Class )<<<<<<<<<<<
Connect to page
ahk_class #32770

and that the ClassNN if the two boxes is edit2 and edit3, and the submit button is button3.

Sorry, new to all this, how do I do that now? I assume I'll want to start with something like
IfWinExist, [Connect to page]
{
ControlSetText, edit2, username 
}

But that didn't do it?

Carcophan
  • Members
  • 1578 posts
  • Last active: Nov 27 2013 06:46 PM
  • Joined: 24 Dec 2008
You will need a 'return' at the end. The 'connect to page' may be the actual host page itself. If you click inside and outside the sign in box, does the title change? If it does not, then you will need the 'controlsettext, edit2, variable' like HotKeyIt said.

mrdata
  • Guests
  • Last active:
  • Joined: --
I think I just don't know how to use the controlsettext command,

^!q::
IfWinExist, Connect to page
{
WinActivate, Connect to page
ControlSetText, edit2, username
}
Return

that activates the right window, but doesn't change anything in the fields?

mrdata
  • Guests
  • Last active:
  • Joined: --
scratch that, I amended a comma in my code in the post before testing it, and that fixed it. Thank you all!

HotKeyIt
  • Moderators
  • 7439 posts
  • Last active: Jun 22 2016 09:14 PM
  • Joined: 18 Jun 2008
Try this:
#IfWinActive Connect to page ahk_class #32770
^!q::
ControlSetText, edit2, username,A
ControlSetText, edit3, password,A
ControlClick, button3,A
Return
#IfWinActive