Fluence Posted March 7, 2012 Share Posted March 7, 2012 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). Link to comment Share on other sites More sharing options...
water Posted March 7, 2012 Share Posted March 7, 2012 (edited) 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 March 7, 2012 by water My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Fluence Posted March 7, 2012 Author Share Posted March 7, 2012 (edited) To a "textbox" in a website. Class: MozillaWindowClass Edited March 7, 2012 by Fluence Link to comment Share on other sites More sharing options...
Realm Posted March 7, 2012 Share Posted March 7, 2012 (edited) Hello Fluence, Welcome to the AutoIt Forums 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 March 7, 2012 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. Link to comment Share on other sites More sharing options...
water Posted March 7, 2012 Share Posted March 7, 2012 Try this: $text = "trololol" & @CRLF & "Line 2" Send ($text, 1) My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Fluence Posted March 7, 2012 Author Share Posted March 7, 2012 Try this: $text = "trololol" & @CRLF & "Line 2" Send ($text, 1) Perfect! Thank you for your help! Link to comment Share on other sites More sharing options...
Realm Posted March 7, 2012 Share Posted March 7, 2012 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. Link to comment Share on other sites More sharing options...
Fluence Posted March 7, 2012 Author Share Posted March 7, 2012 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. Link to comment Share on other sites More sharing options...
water Posted March 7, 2012 Share Posted March 7, 2012 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 (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now