Jump to content

Two guictrlcreateedit windows


sluth
 Share

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

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

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

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...