Jump to content
Sign in to follow this  


Recommended Posts


Ok, i made this simple script for taking notes. But when i press the Save Notes button it saves to the file, but closes the program. Anyway to stop this?

; Script generated by AutoBuilder 0.5 Prototype

#include <GuiConstants.au3>

If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000

GuiCreate("NoteTaker", 552, 359,(@DesktopWidth-552)/2, (@DesktopHeight-359)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)

$file = FileOpen ( "Notes.txt","0")
$notes_file = FileRead($file,"999999")

$Edit_1 = GuiCtrlCreateEdit($notes_file, 10, 10, 530, 310)
$Button_2 = GuiCtrlCreateButton("Save Notes", 10, 320, 530, 30)

While 1
    $msg = GuiGetMsg()
    Case $msg = $GUI_EVENT_CLOSE
    Case $msg = $Button_2
        $file1 = FileOpen ( "Notes.txt","2")
        $contents = GuiCtrlRead($Edit_1)
        $notes_file = FileWrite($file1,$contents)   
    Case Else

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.