Jump to content

Recommended Posts

Posted

I am new to autoit. I have a gui window that has two guictrlcreateedit boxes. I want to be able to paste info into each box and then spit it out into a cmd windows 1 line item at a for each box. So spit out the first line from box 1 and the first line from box 2 then hit enter and move onto the next lines. If someone could help that would be great.

Thanks

Posted

Post your existing code.

If $msg = $fileitem3 Then

GUICreate ("Random Order" , 330, 600,100,100)

GuiSetIcon(@DesktopDir & "\KDLauncher.exe", 0)

GUICtrlSetFont (-1,12)

GUISetState (@SW_SHOW)

GUISetState ($GUI_DROPACCEPTED)

$OK_btn = GUICtrlCreateButton ("OK",125,550,70,20)

$file1 = GuiCtrlCreateEdit("Machine Names", 10, 10, 150, 500, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN,$WS_VSCROLL))

$file2 = GuiCtrlCreateEdit("Com Ports", 170, 10, 150, 500, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN,$WS_VSCROLL))

;GUICtrlCreateEdit("", 0, 0, 497, 233, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN,$WS_VSCROLL, $ES_READONLY))

While $msg <> $GUI_EVENT_CLOSE

$msg = GUIGetMsg()

Select

Case $msg = $OK_btn

$Input1 = GUICtrlRead($file1)

$Input2 = GUICtrlRead($file2)

Run ("cmd")

WinWait ("C:\Windows\system32\cmd.exe")

send ($add & $Input1 & " " & $Input2)

EndSelect

WEnd

EndIf

Posted

Hmm, I'm not really understanding this, maybe he needs StringSplit($String, "&@CRLF&") I think?

Sorry what does that do?

Thanks

Posted (edited)

I think you want to Split the edit one, by lines, and then paste each line into the command window?

Like this?

$Split = StringSplit($Edit1, "&@CRLF&")
For $i=1 To $Split[0]
Send($Split[$i])
Next

Edit the variables to fit your code, and try that

Edited by Swift
Posted

I think you want to Split the edit one, by lines, and then paste each line into the command window?

Like this?

$Split = StringSplit($Edit1, "&@CRLF&")
For $i=1 To $Split[0]
Send($Split[$i])
Next

Edit the variables to fit your code, and try that

Thanks I will give that a try. This forum is great. Response time is way fast. Thanks again
Posted

Thanks I will give that a try. This forum is great. Response time is way fast. Thanks again

Thanks I will give that a try. Great forum. Response time is way fast.
Posted

Thanks I will give that a try. Great forum. Response time is way fast.

And What Was The Point Of That? You Just Said That?
Posted

And What Was The Point Of That? You Just Said That?

Sorry didn't mean to reply twice. Noob to the forum thing as well.
Posted

Sorry didn't mean to reply twice. Noob to the forum thing as well.

It's all good, was just wondering! :D
Posted

It's all good, was just wondering! :D

The code you listed will that only pull from the first box. I can't firgure out how to get it to pull the first line from both boxes and spit it out and then move to the next line.

Thanks for the help

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
  • Recently Browsing   0 members

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