Werner Posted February 25, 2009 Share Posted February 25, 2009 Hi All I have a simple question: What command do I use to click on a button and save the contents of the unbound controls on an AutoIT GUI to a csv file? I am trying to make a tiny application that will capture a few lines of input and saving it for email to a database. Your help will be much appreciated. Werner Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 25, 2009 Moderators Share Posted February 25, 2009 WernerFirst, welcome to the AutoIt forums.When you post here it always helps if you have had a go at solving your problems beforehand. Having some code to work on is a great help - and no-one here is too keen to help the "code it for me" brigade.First, you need to have an idea of how AutoIt works and how to create and interact with a basic GUI. Reading the Help file (at least the first few sections - Using AutoIt, Tutorials and the first couple of References) will help you enormously. You should also look at the excellent tutorials that you will find here and here.Then you can look at how to read controls and write the results to a file. None of this is difficult, but requires some application - by you.So, give it a go yourself and come back with your code if you run into problems.M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Paulie Posted February 27, 2009 Share Posted February 27, 2009 Hi All I have a simple question: What command do I use to click on a button and save the contents of the unbound controls on an AutoIT GUI to a csv file? I am trying to make a tiny application that will capture a few lines of input and saving it for email to a database. Your help will be much appreciated. WernerHere's a small example just to get you started. ;Includes #include <GUIConstants.au3> #include <WindowsConstants.au3> ;Create GUI $GUI= GuiCreate("Input window", 300, 150) GUICtrlCreateLabel("1", 10, 33) GUICtrlCreateLabel("2", 10, 63) $Input_1 = GUICtrlCreateInput("",30,30,240,20) $Input_2 = GUICtrlCreateInput("",30,60,240,20) $Save = GUICtrlCreateButton("Save", 80, 100, 140,30) ;Display GUI GUISetState() ;Start Main loop While 1 Switch GuiGetMsg();Get activity from GUI Case $GUI_EVENT_CLOSE ;Exit when X button is pressed Exit Case $Save ;When saved is pressed $Line = "1: " & GUICtrlRead($Input_1) & @CRLF & "2: " & GUICtrlRead($Input_2);Read the inputs and format output $FILE = FileOpen(@desktopdir&"\Saved Example.txt",1) ;Open the file in write mode FileWrite($File, $Line); write to the opened file FileClose($File);Close the File EndSwitch WEnd Link to comment Share on other sites More sharing options...
Werner Posted March 2, 2009 Author Share Posted March 2, 2009 Melba23 and Paulie. Thank you very much. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now