Sign in to follow this  
Followers 0
MikelSevrel

Simple Variable Input Problem

3 posts in this topic

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (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 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

Thanks for your help :o Had to reconfigure the code alot, but thank you.


Coming soon....

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