Jump to content

paste into an input box


Recommended Posts

I am very new to AutoIt so please be patient. I want to capture data from a terminal emulator as a text file then open the text file and paste it into an input box.

It won't paste into the input box - but does if I manually press CTL V so it does copy

Here is the code snippet

ShellExecute(@MyDocumentsDir & "\test.txt")

Sleep(2000)

Send("{DOWN}{DOWN}{DOWN}{DOWN}")

Send("{LSHIFT}+{RIGHT}")

Send("{LSHIFT}+{RIGHT}")

Send("{LSHIFT}+{RIGHT}")

Send("{CTRLDOWN}+C")

Send("{CTRLUP}")

ProcessClose("notepad.exe")

InputBox("Question", "Work", "", "", -1, -1, 0, 0)

Sleep(5000)

Send("{CTRLDOWN}+v")

Send("{CTRLUP}")

Edited by stilllearning
Link to comment
Share on other sites

try this , it reads test.txt and show inputbox with that text

$Text = FileRead(@MyDocumentsDir & "\test.txt")

InputBox("Question", "Work", $Text, "", -1, -1, 0, 0)

Edited by komalo
[font="Palatino Linotype"][size="3"]AutoIt Script Examples :[/size][/font][font="Palatino Linotype"][size="3"]_CaptureBehindWindowGlass CMD for Windows Vista/Seven[/size][/font][left][/left][font="Palatino Linotype"][size="3"]Non AutoIt Script programs : Border Skin - Aero Glass On XP[/size][/font]
Link to comment
Share on other sites

Don't you have to open the file first to read it?

no

edit: from teh help file :(

If a filename is given rather than a file handle - the file will be opened and closed during the function call - for parsing large text files this will be much slower than using filehandles

But i dont think there is much text , if its going in a inputbox :P Edited by DexterMorgan
code
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...