Jump to content

How to imput value and save like a variable


Go to solution Solved by water,

Recommended Posts

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

Link to comment
Share on other sites

  • Developers

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

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
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)

 

=)
Link to comment
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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
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. =)

Link to comment
Share on other sites

  • Solution

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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...