Jump to content
Sign in to follow this  

Simple Variable Input Problem

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>

GuiCreate("Sample GUI", 400, 400)
GuiSetIcon(@SystemDir & "\mspaint.exe", 0)
Opt("GUIOnEventMode", 1)

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

Func OKButton()
While 1
    $msg = GUIGetMsg(1)

        Case $msg[0] = $okbutton
    MsgBox(0, "GUI Event", "Encoding")

Coming soon....

Share this post

Link to post
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))


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.


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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...