Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find and fill an input field with AutoHotKey

A challenge to all you AutoHotKey masters:

Give us a function that will Find and Move the Cursor to an Input Field (E.g. LoginName) and, alternatively send input text. For the old, lazy hackers like myself just fiddling with AHK, it would look like this:

FindFillField(*elementid*,*sendtext*,*alt-text*)

Where elementid is the HTML id for the field, e.g. USERNAME, where sendtext is the text to fill and where alt-text could be additional, specific text to help identify the fields.

Additional, optional parameters are always helpful to round out odd cases so let your imaginations run wild!

For old-timers like me, and for anyone, this would be a blessing in creating simple login macros.

like image 484
user478094 Avatar asked May 07 '15 13:05

user478094


1 Answers

You can always use the {TAB} option. Open the website and hit the TAB key until you reach the input field and count how many times you hit it. Then do Send {TAB ##}. I used the below to put in First name, middle name, last name, and 2 other id into a web form. The variables were entered into a GUI form that was created.

Send {TAB 41}
Send %firstn%
Send {TAB}
Send %middle%
Send {TAB}
Send %lastn%
Send {TAB}
Send %deas%
Send {TAB}
Send %npis%
Send {TAB 3}
Send {N}
Send {TAB 2}
Send {ENTER}
like image 110
ehepler84 Avatar answered Sep 21 '22 15:09

ehepler84