Jump to content

Simple Variable Input Problem


MikelSevrel
 Share

Recommended Posts

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:

#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

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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...