Sign in to follow this  
Followers 0
Wollf

what i do wrong here?

4 posts in this topic

i try make a exe that will copy paste information from 3 input boxes to the notepad. i use tab to move around input boxes but when it copies first input and paste it at notepad and sends tab then it goes back to input box 2 and then goes to input 3 it doesnt go back to notepad to paste input 2 or input 3.

#include <GUIConstants.au3>
Opt("GUIOnEventMode", 1)  
#Region ### START Koda GUI section ### Form=
$Name_Adder = GUICreate("Name_Adder", 351, 274, 193, 115)
GUISetFont(10, 400, 0, "Monotype Corsiva")
GUISetBkColor(0xC0C0C0)
$Input1 = GUICtrlCreateInput("Input1", 48, 64, 153, 23)
$Input2 = GUICtrlCreateInput("Input2", 48, 116, 153, 23)
$Input3 = GUICtrlCreateInput("Input3", 48, 168, 153, 21)
$Name = GUICtrlCreateLabel("Name", 48, 36, 30, 19)
$Label1 = GUICtrlCreateLabel("Mobile Phone", 48, 92, 69, 19)
$Label2 = GUICtrlCreateLabel("Message", 48, 144, 41, 19)
$Checkbox1 = GUICtrlCreateCheckbox("", 44, 212, 21, 21)
$Label3 = GUICtrlCreateLabel("Check box so all names so they have same message", 72, 212, 192, 19)

$1 = GUICtrlCreateButton("Send info", 232, 64, 77, 49, 0)
GUICtrlSetOnEvent(-1, "Button1")

$2 = GUICtrlCreateButton("Exit", 232, 124, 77, 49, 0)
GUICtrlSetOnEvent(-1,"exit1")

GUICtrlSetFont(-1, 15, 400, 0, "Monotype Corsiva")
GUICtrlSetCursor (-1, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

Func button1()
    ShellExecute("notepad.txt")
    WinWaitActive("C:\Documents and Settings\user\Επιφάνεια εργασίας\Tsagdis\Notepad.txt - Notepad++")
    WinActivate("Name_Adder")
    Send("{tab 2}")
    send("^c")
    WinActivate("C:\Documents and Settings\user\Επιφάνεια εργασίας\Tsagdis\Notepad.txt - Notepad++")
    send("^v")
    send("{tab}")
    WinActivate("Name_Adder")
    Send("{tab}")
    send("^c")
    WinActivate("C:\Documents and Settings\user\Επιφάνεια εργασίας\Tsagdis\Notepad.txt - Notepad++")
    send("^v")
    send("{tab}")
    WinActivate("Name_Adder")
    Send("{tab}")
    send("^c")
    WinActivate("C:\Documents and Settings\user\Επιφάνεια εργασίας\Tsagdis\Notepad.txt - Notepad++")
    send("^v")
    send("{tab}")
    send("{Enter}")
    EndFunc
Func exit1()
    exit
    EndFunc


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

Share this post


Link to post
Share on other sites



You mean like this?

#include <GUIConstants.au3>
Opt("GUIOnEventMode", 1)  
#Region ### START Koda GUI section ### Form=
$Name_Adder = GUICreate("Name_Adder", 351, 274, 193, 115)
GUISetFont(10, 400, 0, "Monotype Corsiva")
GUISetBkColor(0xC0C0C0)
$Input1 = GUICtrlCreateInput("Input1", 48, 64, 153, 23)
$Input2 = GUICtrlCreateInput("Input2", 48, 116, 153, 23)
$Input3 = GUICtrlCreateInput("Input3", 48, 168, 153, 21)
$Name = GUICtrlCreateLabel("Name", 48, 36, 30, 19)
$Label1 = GUICtrlCreateLabel("Mobile Phone", 48, 92, 69, 19)
$Label2 = GUICtrlCreateLabel("Message", 48, 144, 41, 19)
$Checkbox1 = GUICtrlCreateCheckbox("", 44, 212, 21, 21)
$Label3 = GUICtrlCreateLabel("Check box so all names so they have same message", 72, 212, 192, 19)

$1 = GUICtrlCreateButton("Send info", 232, 64, 77, 49, 0)
GUICtrlSetOnEvent(-1, "Button1")

$2 = GUICtrlCreateButton("Exit", 232, 124, 77, 49, 0)
GUICtrlSetOnEvent(-1,"exit1")

GUICtrlSetFont(-1, 15, 400, 0, "Monotype Corsiva")
GUICtrlSetCursor (-1, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

Func button1()
    ShellExecute("notepad")
    WinWaitActive("Untitled - Notepad")
    Send(GUICtrlRead($Input1)&@CRLF&GUICtrlRead($Input2)&@CRLF&GUICtrlRead($Input3))
    EndFunc
Func exit1()
    exit
    EndFunc


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

Sorry 4 Bad English, I'm Indonesian...I'm really need 'Translator' for helping me posting in this forum (http://deeriee.wordpress.com)

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Thanks very much

Edited by Wollf

Share this post


Link to post
Share on other sites

Now i need a little help i made a new one with 36 inputs and 1 check box i want to copy/paste the info on notepad but i dont want to copy an input that doesnt have text so notepad file wont have spaces.

Also i want when someone presses the checkbox the 3rd input boxes to be all the same something like copy first third input box and paste it at all other third boxes under or if checkbox is pressed it will take only input 3 message and will up it at third line in every line in notepad

i ll put an image because i dont know if you understanted i want if checkbox is checked input 3 will replace input 9 input 12 input 15... input 36.

http://i310.photobucket.com/albums/kk414/L...ki/f0ce0aa2.jpg

#include <GUIConstants.au3>
Opt("GUIOnEventMode", 1) 
#Region ### START Koda GUI section ### Form=f:\autoit3\koda\forms\form1.kxf
$Form1_1 = GUICreate("Form1", 633, 447, 193, 125, -1, 0)
$Label1 = GUICtrlCreateLabel("Name", 28, 16, 52, 29)
GUICtrlSetFont(-1, 16, 800, 2, "Monotype Corsiva")
$Label2 = GUICtrlCreateLabel("Phone", 204, 16, 55, 29)
GUICtrlSetFont(-1, 16, 800, 2, "Monotype Corsiva")
$Message = GUICtrlCreateLabel("Message", 360, 16, 74, 29)
GUICtrlSetFont(-1, 16, 800, 2, "Monotype Corsiva")
$Checkbox1 = GUICtrlCreateCheckbox("Check box so all have same messages will be same", 20, 396, 437, 29)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
$Input29 = GUICtrlCreateInput("", 160, 308, 149, 21)
$Input2 = GUICtrlCreateInput("", 160, 56, 149, 21)
$Input3 = GUICtrlCreateInput("", 320, 56, 149, 21)
$Input4 = GUICtrlCreateInput("", 0, 84, 149, 21)
$Input5 = GUICtrlCreateInput("", 160, 84, 149, 21)
$Input6 = GUICtrlCreateInput("", 320, 84, 149, 21)
$Input7 = GUICtrlCreateInput("", 0, 112, 149, 21)
$Input8 = GUICtrlCreateInput("", 160, 112, 149, 21)
$Input9 = GUICtrlCreateInput("", 320, 112, 149, 21)
$Input10 = GUICtrlCreateInput("", 0, 140, 149, 21)
$Input11 = GUICtrlCreateInput("", 160, 140, 149, 21)
$Input12 = GUICtrlCreateInput("", 320, 140, 149, 21)
$Input13 = GUICtrlCreateInput("", 0, 168, 149, 21)
$Input14 = GUICtrlCreateInput("", 160, 168, 149, 21)
$Input15 = GUICtrlCreateInput("", 320, 168, 149, 21)
$Input16 = GUICtrlCreateInput("", 0, 196, 149, 21)
$Input17 = GUICtrlCreateInput("", 160, 196, 149, 21)
$Input18 = GUICtrlCreateInput("", 320, 196, 149, 21)
$Input19 = GUICtrlCreateInput("", 0, 224, 149, 21)
$Input20 = GUICtrlCreateInput("", 160, 224, 149, 21)
$Input21 = GUICtrlCreateInput("", 320, 224, 149, 21)
$Input22 = GUICtrlCreateInput("", 0, 252, 149, 21)
$Input23 = GUICtrlCreateInput("", 160, 252, 149, 21)
$Input24 = GUICtrlCreateInput("", 320, 252, 149, 21)
$Input25 = GUICtrlCreateInput("", 0, 280, 149, 21)
$Input26 = GUICtrlCreateInput("", 160, 280, 149, 21)
$Input27 = GUICtrlCreateInput("", 320, 280, 149, 21)
$Input28 = GUICtrlCreateInput("", 0, 308, 149, 21)
$Input1 = GUICtrlCreateInput("", 0, 52, 149, 21)
$Input30 = GUICtrlCreateInput("", 320, 308, 149, 21)
$Input31 = GUICtrlCreateInput("", 0, 336, 149, 21)
$Input32 = GUICtrlCreateInput("", 160, 336, 149, 21)
$Input33 = GUICtrlCreateInput("", 320, 336, 149, 21)
$Input34 = GUICtrlCreateInput("", 0, 364, 149, 21)
$Input35 = GUICtrlCreateInput("", 160, 364, 149, 21)
$Input36 = GUICtrlCreateInput("", 320, 364, 149, 21)
$Button1 = GUICtrlCreateButton("Send info", 492, 56, 117, 53, 0)
GUICtrlSetOnEvent(-1, "Button1")

GUICtrlSetFont(-1, 14, 800, 2, "Monotype Corsiva")
GUICtrlSetCursor (-1, 0)

$Button2 = GUICtrlCreateButton("Exit", 492, 136, 113, 37, 0)
GUICtrlSetOnEvent(-1, "exit1")

GUICtrlSetFont(-1, 14, 800, 2, "Monotype Corsiva")
GUICtrlSetCursor (-1, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
Func button1()
    ShellExecute("notepad.txt")
    WinWaitActive("C:\Documents and Settings\user\Επιφάνεια εργασίας\Tsagdis\Notepad.txt - Notepad++")
    Send(GUICtrlRead($Input1)&@TAB&GUICtrlRead($Input2)&@TAB&GUICtrlRead($Input3)&@CRLF)
    Send(GUICtrlRead($Input4)&@TAB&GUICtrlRead($Input5)&@TAB&GUICtrlRead($Input6)&@CRLF)
    Send(GUICtrlRead($Input7)&@TAB&GUICtrlRead($Input8)&@TAB&GUICtrlRead($Input9)&@CRLF)
    Send(GUICtrlRead($Input10)&@TAB&GUICtrlRead($Input11)&@TAB&GUICtrlRead($Input12)&@CRLF)
    Send(GUICtrlRead($Input13)&@TAB&GUICtrlRead($Input14)&@TAB&GUICtrlRead($Input15)&@CRLF)
    Send(GUICtrlRead($Input16)&@TAB&GUICtrlRead($Input17)&@TAB&GUICtrlRead($Input18)&@CRLF)
    Send(GUICtrlRead($Input19)&@TAB&GUICtrlRead($Input20)&@TAB&GUICtrlRead($Input21)&@CRLF)
    Send(GUICtrlRead($Input22)&@TAB&GUICtrlRead($Input23)&@TAB&GUICtrlRead($Input24)&@CRLF)
    Send(GUICtrlRead($Input25)&@TAB&GUICtrlRead($Input26)&@TAB&GUICtrlRead($Input27)&@CRLF)
    Send(GUICtrlRead($Input28)&@TAB&GUICtrlRead($Input29)&@TAB&GUICtrlRead($Input30)&@CRLF)
    Send(GUICtrlRead($Input31)&@TAB&GUICtrlRead($Input32)&@TAB&GUICtrlRead($Input33)&@CRLF)
    Send(GUICtrlRead($Input34)&@TAB&GUICtrlRead($Input35)&@TAB&GUICtrlRead($Input36)&@CRLF)
EndFunc

Func exit1()
    exit
    EndFunc






While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

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  
Followers 0