MikelSevrel Posted February 21, 2006 Share Posted February 21, 2006 Hi, I'm trying to create a script that will launch a gui with a few text input boxes for variables, and then have a button to start a .bat file with the variables. I can't seem to figure it out. Here's what I have at the moment: expandcollapse popup#include <GuiConstants.au3> ; GUI GuiCreate("Sample GUI", 400, 400) GuiSetIcon(@SystemDir & "\mspaint.exe", 0) Opt("GUIOnEventMode", 1) ; INPUT GUICtrlCreateLabel("Channel Number", 10, 5, 50) $CHANNEL = GUICtrlCreateInput("", 10, 20, 380, 20) GUICtrlCreateLabel("Program Title", 10, 40, 50) $TITLE = GUICtrlCreateInput("", 10, 55, 380, 20) GUICtrlCreateLabel("Program Length in Minutes", 10, 75, 250) $LENGTH = GUICtrlCreateInput("", 10, 90, 380, 20) $okbutton = GUICtrlCreateButton("Capture", 10, 130, 380, 60) GUISetOnEvent($okbutton, "OKButton") GUISetState(@SW_SHOW) Func OKButton() While 1 $msg = GUIGetMsg(1) Select Case $msg[0] = $okbutton EnvSet("$CHANNEL") EnvSet("$TITLE") EnvSet("$LENGTH") MsgBox(0, "GUI Event", "Encoding") RunWait("capture.bat") ExitLoop EndSelect WEnd EndFunc Coming soon.... Link to comment Share on other sites More sharing options...
GaryFrost Posted February 21, 2006 Share Posted February 21, 2006 (edited) you need to tell it what evironment variable to set and to do a read on the control EnvSet("evironment var name",GUICtrlRead($CHANNEL)) EnvSet("evironment var name",GUICtrlRead($TITLE)) EnvSet("evironment var name",GUICtrlRead($LENGTH)) also Edited February 21, 2006 by gafrost SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
MikelSevrel Posted February 21, 2006 Author Share Posted February 21, 2006 Thanks for your help Had to reconfigure the code alot, but thank you. Coming soon.... 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