Jump to content
Sign in to follow this  

How to get the value of an text box

Recommended Posts


I have a small GUI like getting two numbers and want to add those two numbers.

Here i used AutoIt script to test this small GUI.

Here is the code for your reference:

If WinExists("[TITLE:Test Form]") Then

;MsgBox(0, "", "Window exists")

$list = ProcessList("TestApplication.exe")

for $i = 1 to $list

WinActivate("[TITLE:Test Form]", "")



MsgBox(0, "", "Please Open the Appication")


$sNo = ControlGetText("[TITLE:Test Form]", "txtFirstNumber", 1770450)



--Issue noticed here is 'ControlId' of ControlGetText() changes when we relaunch the GUI, So i am not able to get the value of the textbox to proceed further..

It would be really great,if someone could help me..

Share this post

Link to post
Share on other sites

Look up ProcessList() in the help file. It returns an array, not an integer appropriate for your For/Next loop.

Look up Controls in the help file. Review the various "special descriptions" that can be used to identify a control.


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

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