Sign in to follow this  
Followers 0
KillingEye

How to write a variable in a document?

4 posts in this topic

Hi,

i want to use the text from a inputbox (but better from a editbox) and write it into a textdocument.

But i dont know how :)

Here is my script

#include <GuiConstantsEx.au3>
#include <AVIConstants.au3>
#include <TreeViewConstants.au3>

; GUI
GUICreate("My First GUI", 400, 400)


; Menü

$menu1 = GUICtrlCreateMenu("Datei")
$menu2 = GUICtrlCreateMenu("Menü 2")
$helpmenu = GUICtrlCreateMenu("?")


    $menu1item1 = GUICtrlCreateMenuItem("Öffnen...", $menu1)   
        $menu2item1 = GuiCtrlCreateMenuItem("Wtf?...", $menu2)
        $menu2item2 = GuiCtrlCreateMenuItem("XXX", $menu2)
        $menu2item3 = GuiCtrlCreateMenuItem("XXX2", $menu2)
        
    $aboutitem = GUICtrlCreateMenuItem("About", $helpmenu)
    
    $separator1 = GUICtrlCreateMenuItem("", $menu1)
    $exititem = GUICtrlCreateMenuItem("Exit", $menu1)
    
    GUICtrlCreateLabel("Link:", 1, 10)
    $inputboxbutton = GUICtrlCreateButton("Inputbox", 1, 20)
    
    
    
; Exit
_Main()


Func _Main()
    
    GUISetState()
    
    
    While 1 
        $msg = GUIGetMsg()


        Select
            Case    $msg = $exititem; Exit Funktion in Datei
                MsgBox(32,"Exit Window","Exit GUI?")
                ExitLoop
                
            Case      $msg = $aboutitem; About Fenster
                MsgBox(4128,"About Window","Creator:                 XXX" & @CRLF & "Homepage:          www.XXX.XX" & @CRLF & "")
                
            Case    $msg = $menu1item1; Öffnen wird so gestartet
                $fileopen = FileOpenDialog("Öffne Datei", @DesktopCommonDir, "all (*.*)")
                
            Case $msg = $GUI_EVENT_CLOSE ; Close
                ExitLoop
                
            Case $msg = $menu2item2 
                
                
            Case $msg = $menu2item3
                Run("F:\X.exe")
                
                
            Case $msg = $inputboxbutton
                $text = Inputbox("Text","Bitte einen Text eingeben")
            
            
            ase $msg = $text
                Run("notepad.exe")
                WinWaitActive("Unbenannt - Editor")
                Send($text)
                
                
        
        
        
        EndSelect
    WEnd
    
    GUIDelete()
    
    Exit
    
    
EndFunc

Share this post


Link to post
Share on other sites



#include <GuiConstantsEx.au3>
#include <AVIConstants.au3>
#include <TreeViewConstants.au3>

; GUI
GUICreate("My First GUI", 400, 400)


; Menü

$menu1 = GUICtrlCreateMenu("Datei")
$menu2 = GUICtrlCreateMenu("Menü 2")
$helpmenu = GUICtrlCreateMenu("?")


$menu1item1 = GUICtrlCreateMenuItem("Öffnen...", $menu1)
$menu2item1 = GUICtrlCreateMenuItem("Wtf?...", $menu2)
$menu2item2 = GUICtrlCreateMenuItem("XXX", $menu2)
$menu2item3 = GUICtrlCreateMenuItem("XXX2", $menu2)

$aboutitem = GUICtrlCreateMenuItem("About", $helpmenu)

$separator1 = GUICtrlCreateMenuItem("", $menu1)
$exititem = GUICtrlCreateMenuItem("Exit", $menu1)

GUICtrlCreateLabel("Link:", 1, 10)
$inputboxbutton = GUICtrlCreateButton("Inputbox", 30, 20)
$edit = GUICtrlCreateEdit("Test",50,50,300,200)

; Exit
_Main()

Func _Main()
    GUISetState()
    While 1
        $msg = GUIGetMsg()
        Select
            Case $msg = $exititem; Exit Funktion in Datei
                MsgBox(32, "Exit Window", "Exit GUI?")
                ExitLoop

            Case $msg = $aboutitem; About Fenster
                MsgBox(4128, "About Window", "Creator:                 XXX" & @CRLF & "Homepage:            www.XXX.XX" & @CRLF & "")

            Case $msg = $menu1item1; Öffnen wird so gestartet
                $fileopen = FileOpenDialog("Öffne Datei", @DesktopCommonDir, "all (*.*)")

            Case $msg = $GUI_EVENT_CLOSE ; Close
                ExitLoop

            Case $msg = $menu2item2


            Case $msg = $menu2item3
                Run("F:\X.exe")
            Case $msg = $inputboxbutton
                    Run("notepad.exe")
                    WinWaitActive("Unbenannt - Editor")
                    Send(GUICtrlRead($edit))
        EndSelect
    WEnd
    GUIDelete()
    Exit
EndFunc   ;==>_Main


You can help! Donate to AutoIt! or, visit ClimatePREDICTION.netMy posts:Travian Bot Example (100+ servers) BETAHow to Host you code/app for free! (unlimited team number) (Public or Private)"Sir, we're surrounded!" "Excellent. We can attack in any direction!"

Share this post


Link to post
Share on other sites

Yeah, ok.

Thank you for your fast help :)

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