GersonSevero

How to imput value and save like a variable

7 posts in this topic

Sorry if the question it's so easy, but i'm learning recently how AutoIt works =) 

In my script, I need to show a GUI for the user, after the user insert a number,
and then I need to save that number in a variable to use, for example, write that number in a notepad.

I'm waiting for answer. 
Thanks

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

and then I need to save that number in a variable to use, for example, write that number in a notepad.

GuiCtrlRead() should do that, so show what you have that isn't working.

Jos

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

GuiCtrlRead() should do that, so show what you have that isn't working.

Jos

This is an example of my problem.

The number that the user inserts, need to be write in the notepad

MsgBox(0, "Teste", "Programa de Automação de Simulações")
Run("notepad.exe")


$Name = InputBox(Default, "Insira o Módulo de Resiliência[1]: MPa", "","", Default, Default, Default, Default, 10)

 

=)

Share this post


Link to post
Share on other sites

Why do you need to write the number to Notepad? Couldn't you simply write the number into a file and then call Notepad to display the file?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Why do you need to write the number to Notepad? Couldn't you simply write the number into a file and then call Notepad to display the file?

In fact, I have to imput that number in another program used in civil engineering, but the value have to be the number that the user inserts =) 

I thought to create this imput box, and after the user insert that number, write that number in the program, using MouseClick informing coordinates etc.

I really apreciate your answer, you will help me to make my completion of course work. =)

Share this post


Link to post
Share on other sites

More reliable than to use MouseClick is to use ControlSend. This is not always possible so you should run the AutoIt Window Info tool to see if it returns any information about the control in the other program.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

More reliable than to use MouseClick is to use ControlSend. This is not always possible so you should run the AutoIt Window Info tool to see if it returns any information about the control in the other program.

Thanks, you help me a lot. 

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