Jump to content
Sign in to follow this  
Fluence

I need to Send a 20 line text via AutoIt, but I don't know how

Recommended Posts

Fluence

Hello, it's my first time using AutoIt.

I know how to send 1 line text, by doing this:

$text = "trololol"

Send ($text, 1)

But I've got absolutely no idea, how to send a 20 line text.

I was thinking in loading it from a external .txt file, or write the 20 line text direcly into the code, I wouldn't mind that, but I've looked at the AutoIt docs, and it just explains how to send a 1 line text (I've might missed something, I don't know).

Share this post


Link to post
Share on other sites
water

Welcome to AutoIt and the forum!

Where do you want to send the text to? Means: Which program is the target of the send command?

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
Fluence

To a "textbox" in a website.

Class: MozillaWindowClass

Edited by Fluence

Share this post


Link to post
Share on other sites
Realm

Hello Fluence,

Welcome to the AutoIt Forums :oops:

First of all, your explanation is a bit vague and general. With what you have provided, there are many directions to go.

First, Is the 'lines of text' possibly going to change during or between application operations? If so, I'd suggest reading it from a file with one of these methods:

FileRead()

FileReadLine()

_FileReadtoArray()

Second, what are you sending to? Another File? A control? Another Application via Control? Another Application via Commandline? or?

Another File:

FileWrite()

FileWriteLine()

A control in your application/script:

GuiCtrlSetData()

Another Application via a Control:

ControlSetText()

ControlSend()

Another Application via Commandline:

Run()

From your vague description it appears your sending text to another application via a control. Using Send() in this instance is not recommended since it can be interrupted by user input. ControlSetText() would be a better option

Realm

PS. When asking for help, there are few things you should always include. First, a brief description of what your trying to accomplish. Secondly, what elements are being used like files, other applications and so on. Third, and example of the code you are having problems with. This will receive more accurate advice since they will have a better grasp of your project.

Edit: Typos

Edited by Realm

My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry.  

Share this post


Link to post
Share on other sites
water

Try this:

$text = "trololol" & @CRLF & "Line 2"
Send ($text, 1)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
Fluence

Try this:

$text = "trololol" & @CRLF & "Line 2"
Send ($text, 1)

Perfect! Thank you for your help!

Share this post


Link to post
Share on other sites
Realm

Does it have to be Mozilla?

AutoIt3 has a wonderful UDF called IE.au3 for automating Internet Explorer and most Web elements.

There is a UDF for FireFox somewhere in the examples as well, however, last I checked it was not being maintained and updated often.


My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry.  

Share this post


Link to post
Share on other sites
Fluence

Hmmm, I've got to read about that "UDF" thing, I'm having problems now, because my mouseclicks, depend on the position of the firefox window, and of course that's lame.

I need to find a solution for this, I would prefer to use Firefox over IE, but if I've got to use IE to make the things work, well, I'll just use it.

Share this post


Link to post
Share on other sites
water

I think it should be possible with FF too but here you will get far more support for IE than for FF.

Download the UDF, install mozrepl and give it a try.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

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  

×