Sign in to follow this  
Followers 0
spuri

input

12 posts in this topic

#1 ·  Posted (edited)

I am very new to autoit, but I am on half way with my program. I could figure out directory listing and dropdownmenu, I hope I will find dosrun but I can't get my inputbox value. :mellow: How could I get Input1 value?

...
$Input1 = GUICtrlCreateInput("", 28, 125, 345, 22)
...
$project = GUICtrlRead($Input1)
Msgbox(0,"test",  $project )
Msgbox(0,"test",  $Input1 )
...
Edited by spuri

Share this post


Link to post
Share on other sites



I am very new to autoit, but I am on half way with my program. I could figure out directory listing and dropdownmenu, I hope I will find dosrun but I can't get my inputbox value. :mellow: How could I get Input1 value?

...
$Input1 = GUICtrlCreateInput("", 28, 125, 345, 22)
...
$project = GUICtrlRead($Input1)
Msgbox(0,"test",  $project )
Msgbox(0,"test",  $Input1 )
...
GuiCtrlRead is the proper function for capturing GUI input. Post the whole script and we can help find the problem.

Certifications: A+, Network+, Security+, Linux+, LPIC-1, MCSA | Languages: AutoIt, C, SQL, .NETBooks: AutoIt v3: Your Quick Guide - $7.99 - O'Reilly Media - September 2007-------->[u]AutoIt v3 Development - newbie to g33k[/u] - Coming Soon - Fate Publishing - Spring 2013UDF Libraries: SkypeCOM UDF Library | ADUC Computers OU Cleanup | Find PixelChecksumExamples: Skype COM Examples - Skype4COMLib Examples converted from VBS to AutoIt

Share this post


Link to post
Share on other sites

I am very new to autoit, but I am on half way with my program. I could figure out directory listing and dropdownmenu, I hope I will find dosrun but I can't get my inputbox value. :mellow: How could I get Input1 value?

...
 $Input1 = GUICtrlCreateInput("", 28, 125, 345, 22)
 ...
 $project = GUICtrlRead($Input1)
 Msgbox(0,"test",  $project )
 Msgbox(0,"test",  $Input1 )
 ...
Use the included inputbox function and then you will not need the GUICtrlRead to read the value of your inputbox.

$input1 = InputBox("Blank input","Input something here:",'','','', 28, 125, 345, 22)

MsgBox(0,'',$input1)

Kerros===============================================================How to learn scripting: Figure out enough to be dangerous, then ask for assistance.

Share this post


Link to post
Share on other sites

GUICtrlRead is the proper way to read it, but its impossible to tell whats wrong without your full script.

Share this post


Link to post
Share on other sites

Kerros is right :

$input1 = InputBox("Blank input","Input something here","The text you want to read","","", 28, 125, 345, 22)

MsgBox(0,"Read InputBox","The text write in inputbox is :"&$input1)

Just use the constant of your inputbox


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

thanks inputbox works with Kerros's example butnot with GUICtrlCreateInput

$Input1 = GUICtrlCreateInput("", 28, 125, 345, 22)

I would like to xcopy d:\templateclient\tempproj dir to D:\{selected-dir-client}\tempproj

full code

#Region ### START Koda GUI section ### Form=c:\program files\autoit3\forms\mb01.kxf
$Form1 = GUICreate("Project-R", 413, 305, 272, 188)
    GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")
GUISetIcon("D:\81.ico")
$PageControl1 = GUICtrlCreateTab(8, 8, 396, 256)
GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
$TabSheet1 = GUICtrlCreateTabItem("New Project")
$Button2 = GUICtrlCreateButton("Create Project", 272, 208, 75, 25, 0)
    GUICtrlSetOnEvent(-1, "NewClientClick")
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$Combo1 = GUICtrlCreateCombo("", 36, 77, 337, 25)
    GUICtrlSetOnEvent(-1, "Combo1Change")
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
GUICtrlSetFont(-1, 8, 400, 0, "Arial")

;---problem2---- !!!!!!!!!!!!!!!
GUICtrlCreateInput("", 40, 168, 337, 22)

GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$TabSheet2 = GUICtrlCreateTabItem("New Client")

;---problem2----
$Input1 = GUICtrlCreateInput("", 28, 125, 345, 22)

GUICtrlSetFont(-1, 8, 400, 0, "Arial")
GUICtrlCreateTabItem("")

$Exit = GUICtrlCreateButton("&Exit", 318, 272, 75, 25, 0)
GUICtrlSetOnEvent(-1, "Exitclick")

$input11 = InputBox("Blank input","Input something here:",'','','', 28, 125, 345, 22)



GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###


While 1                 
    Sleep(100)
WEnd


;------------------------------------Backup Button Function-------------------------------------------
Func NewClientClick()
    $client = GUICtrlRead($Combo1)
    $project = GUICtrlRead($Input1)

        Msgbox(0,$project,  $client )

EndFunc
;-------------------------------------End of Backup Button Function------------------------------------------
Edited by spuri

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

thanks inputbox works with Kerros's example butnot with GUICtrlCreateInput

$Input1 = GUICtrlCreateInput("", 28, 125, 345, 22)

GuiCtrlRead($Input1);Read the input

I would like to xcopy d:\templateclient\tempproj dir to D:\{selected-dir-client}\tempproj

DirCopy("D:\templateclient\tempproj","D:\"&GuiCtrlRead($Input1)&"\tempproj",flag)
Edited by FireFox

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

You are right but I need to copy ACL so probably xcopy is the answer and I still can not get the $Input1 value.

why this does not work?

Func NewClientClick()
    $project = GUICtrlRead($Input1)
    Msgbox(0,'test',  $project )
EndFunc

I get this

Posted Image

should this variable be global?

Edited by spuri

Share this post


Link to post
Share on other sites

I get this (12) if I changed the code as below

Posted Image

Func NewClientClick()
    GUICtrlRead($Input1)
    Msgbox(0,'test',  $Input1 )
EndFunc

Share this post


Link to post
Share on other sites

You are not looking at the right input box. In your code, the input you are looking for is on line 39. If you delete line 44, and assign input on line 39 to $Input1 [e.g., $Input1 = GUICtrlCreateInput("", 40, 168, 337, 22)], everything works OK.

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

ouccchh - many thaks - works fine

Edited by spuri

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

this works also

$RunP = RunWait( @ComSpec & " /c xcopy D:\_TemplateProject_0000\CLIENT D:\test\" & $client & "\ /T /E /O" )
    Msgbox(0,"project-test",  $RunP )
Edited by spuri

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