nivek Posted February 1, 2010 Share Posted February 1, 2010 What am I missing? BTW: first GUI Script.. expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Opt("TrayAutoPause",0) $Form1 = GUICreate("Folder Maker", 250, 130, 378, 159) $Checkbox1 = GUICtrlCreateCheckbox("contract", 8, 64, 89, 17) $Checkbox2 = GUICtrlCreateCheckbox("Leases", 104, 64, 89, 17) $Checkbox3 = GUICtrlCreateCheckbox("Misc", 200, 64, 41, 17) $Input1 = GUICtrlCreateInput("", 120, 8, 121, 21) $Input2 = GUICtrlCreateInput("", 120, 32, 121, 21) $Label1 = GUICtrlCreateLabel("Enter Company Name", 8, 8, 107, 17) $Label2 = GUICtrlCreateLabel("Enter ID#", 8, 32, 83, 17) $Button1 = GUICtrlCreateButton("Run", 16, 96, 75, 25, $WS_GROUP) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $button1 Start() EndSwitch WEnd Func Start() If $Checkbox1 = 0 Then FileMove("\\server\scan\contract\*.pdf", $Input1 & "/" & $Input2 & "/" & $Input2 & " Contract.pdf") EndIf If $Checkbox2 = 0 Then FileMove("\\server\scan\leases\*.pdf", $Input1 & "/" & $Input2 & "/" & $Input2 & " leases.pdf") EndIf If $Checkbox3 = 0 Then FileMove("\\server\scan\misc\*.pdf", $Input1 & "/" & $Input2 & "/" & $Input2 & " misc.pdf") EndIf EndFunc Link to comment Share on other sites More sharing options...
Developers Jos Posted February 1, 2010 Developers Share Posted February 1, 2010 You are testing the ControlHandle in stead of the "value" of the Control. Use GuiCtrlRead(). Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
nivek Posted February 1, 2010 Author Share Posted February 1, 2010 You are testing the ControlHandle in stead of the "value" of the Control. Use GuiCtrlRead().JosJos I have gone back to the autoit help and forums, I am still confused on this.can you give a little more help on this? Link to comment Share on other sites More sharing options...
Developers Jos Posted February 1, 2010 Developers Share Posted February 1, 2010 Jos I have gone back to the autoit help and forums, I am still confused on this. can you give a little more help on this? I meant something like this: If GUICtrlRead($Checkbox1) = $GUI_CHECKED Then Does that make it any clearer ? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 1, 2010 Moderators Share Posted February 1, 2010 nivek,When you create a control in AutoIt, the control is given a unique identity - called the ControlID, This is what AutoIt uses to distinguish between all the controls on your GUI. We can go into a lot more detail but that is the short version. So when you try and use what is in your inputs:FileMove("\\server\scan\contract\*.pdf", $Input1 & "/" & $Input2 & "/" & $Input2 & " Contract.pdf")you are currently using the ControIDs of the input controls - not what is in them.What you should do is this:FileMove("\\server\scan\contract\*.pdf", GUICtrlRead($Input1) & "/" & GUICtrlRead($Input2) & "/" & GUICtrlRead($Input2) & " Contract.pdf")Does that make sense? Please ask if you are still not sure - that is why we are here. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
nivek Posted February 1, 2010 Author Share Posted February 1, 2010 (edited) expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Opt("TrayAutoPause",0) $Form1 = GUICreate("Folder Maker", 250, 130, 378, 159) $Checkbox1 = GUICtrlCreateCheckbox("contract", 8, 64, 89, 17) $Checkbox2 = GUICtrlCreateCheckbox("Leases", 104, 64, 89, 17) $Checkbox3 = GUICtrlCreateCheckbox("Misc", 200, 64, 41, 17) $Input1 = GUICtrlCreateInput("", 120, 8, 121, 21) $Input2 = GUICtrlCreateInput("", 120, 32, 121, 21) $Label1 = GUICtrlCreateLabel("Enter Company Name", 8, 8, 107, 17) $Label2 = GUICtrlCreateLabel("Enter ID#", 8, 32, 83, 17) $Button1 = GUICtrlCreateButton("Run", 16, 96, 75, 25, $WS_GROUP) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $button1 Start() EndSwitch WEnd Func Start() DirCreate($Input1) DirCreate($Input1 & "/" & $Input2) FileCopy("*.xlsx", $Input1 & "/" & $Input2 & "/Notes for " & $Input2 & ".xlsx") If GUICtrlRead($Checkbox1) = $GUI_CHECKED Then FileMove("\\server\scan\contract\*.pdf", $Input1 & "/" & $Input2 & "/" & $Input2 & " Contract.pdf") If GUICtrlRead($Checkbox2) = $GUI_CHECKED Then FileMove("\\service-manager\scan\leases\*.pdf", $Input1 & "/" & $Input2 & "/" & $Input2 & " leases.pdf") If GUICtrlRead($Checkbox3 = $GUI_CHECKED Then FileMove("\\service-manager\scan\misc\*.pdf", $Input1 & "/" & $Input2 & "/" & $Input2 & " misc.pdf") EndFunc With this I get a folder called 6 with a folder called 7 inside. Edited February 1, 2010 by nivek Link to comment Share on other sites More sharing options...
Developers Jos Posted February 1, 2010 Developers Share Posted February 1, 2010 With this I get a folder called 6 with a folder called 7 inside.Same issue as also Melba23 pointed out in the post above your last. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Mikesch Posted February 1, 2010 Share Posted February 1, 2010 You got some fine replies from the Pros. That might have solved your problem already. Being a beginner, too, I sometimes need to see Code snippets in a more 'step-by-step' like style. So I hope you don't mind if I use your code with some addition just to make clear what you'll need to do. expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Opt("TrayAutoPause", 0) $Form1 = GUICreate("Folder Maker", 250, 130, 378, 159) $Checkbox1 = GUICtrlCreateCheckbox("contract", 8, 64, 89, 17) $Checkbox2 = GUICtrlCreateCheckbox("Leases", 104, 64, 89, 17) $Checkbox3 = GUICtrlCreateCheckbox("Misc", 200, 64, 41, 17) $Input1 = GUICtrlCreateInput("", 120, 8, 121, 21) $Input2 = GUICtrlCreateInput("", 120, 32, 121, 21) $Label1 = GUICtrlCreateLabel("Enter Company Name", 8, 8, 107, 17) $Label2 = GUICtrlCreateLabel("Enter ID#", 8, 32, 83, 17) $Button1 = GUICtrlCreateButton("Run", 16, 96, 75, 25, $WS_GROUP) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 Start() EndSwitch WEnd Func Start() ;Check state of your checkboxes, values are stored in these variables $ischecked1 = GUICtrlRead($Checkbox1) $ischecked2 = GUICtrlRead($Checkbox2) $ischecked3 = GUICtrlRead($Checkbox3) If $ischecked1 = 4 Then ;will return 4 if unchecked, 1 if checked, now you use the variables, not the ControlIDs MsgBox(0, "", "First Action") FileMove("\\server\scan\contract\*.pdf", $Input1 & "/" & $Input2 & "/" & $Input2 & " Contract.pdf") EndIf If $ischecked2 = 4 Then FileMove("\\server\scan\leases\*.pdf", $Input1 & "/" & $Input2 & "/" & $Input2 & " leases.pdf") EndIf If $ischecked3 = 4 Then FileMove("\\server\scan\misc\*.pdf", $Input1 & "/" & $Input2 & "/" & $Input2 & " misc.pdf") EndIf EndFunc ;==>Start Regards, Mike Link to comment Share on other sites More sharing options...
Developers Jos Posted February 1, 2010 Developers Share Posted February 1, 2010 @mikesch, Your snippet doesn't read the $inputx Controls and also still puts in the handles in the FileMove() commands. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 1, 2010 Moderators Share Posted February 1, 2010 Mikesch,You forgot about the Inputs....... M23P.S. But do not be put off - please help where you can. That is why we are all here, after all! Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
kaotkbliss Posted February 1, 2010 Share Posted February 1, 2010 $input1, $input2, $input3 are the names of your buttons and check boxes and stuff. For autoit to use what a user enters, clicks and checks use GuictrlRead() to read what was entered into the control. The name of the button ($input1, $input2, $input3, etc.) goes inside of the () an example would be you have an input named $variablebox user enters "duh" into the input. you want to read the input of $variablebox (what the user entered) GuictrlRead($variablebox) will return "duh" however just $variableblebox (without the GuictrlRead) will return the internal number of the input. 010101000110100001101001011100110010000001101001011100110010000 001101101011110010010000001110011011010010110011100100001 My Android cat and mouse gamehttps://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek We're gonna need another Timmy! Link to comment Share on other sites More sharing options...
Mikesch Posted February 1, 2010 Share Posted February 1, 2010 Mikesch,You forgot about the Inputs....... M23P.S. But do not be put off - please help where you can. That is why we are all here, after all! I'm not put off at all, just missed the last half hour's posts and thus a lot of meantime 'development', was busy on the phone ;-) Mike Link to comment Share on other sites More sharing options...
nivek Posted February 1, 2010 Author Share Posted February 1, 2010 This is the NON-GUI version And it works.. If Not IsDeclared("sInputBoxAnswer") Then Local $sInputBoxAnswer $sInputBoxAnswer = InputBox("Folder Maker", "Enter Company Name", "", " M", "-1", "-1", "-1", "-1") Select Case @error = 0 Case @error = 1 Case @error = 3 EndSelect If Not IsDeclared("sInputBoxAnswer2") Then Local $sInputBoxAnswer2 $sInputBoxAnswer2 = InputBox("Folder Maker", "Enter Copier ID#", "", " M", "-1", "-1", "-1", "-1") Select Case @error = 0 Case @error = 1 Case @error = 3 EndSelect DirCreate($sInputBoxAnswer) DirCreate($sInputBoxAnswer & "/" & $sInputBoxAnswer2) FileCopy("*.xlsx", $sInputBoxAnswer & "/" & $sInputBoxAnswer2 & "/Notes for " & $sInputBoxAnswer2 & ".xlsx") FileMove("\\service-manager\scan\contract\*.pdf", $sInputBoxAnswer & "/" & $sInputBoxAnswer2 & "/" & $sInputBoxAnswer2 & " Contract.pdf") FileMove("\\service-manager\scan\leases\*.pdf", $sInputBoxAnswer & "/" & $sInputBoxAnswer2 & "/" & $sInputBoxAnswer2 & " leases.pdf") FileMove("\\service-manager\scan\misc\*.pdf", $sInputBoxAnswer & "/" & $sInputBoxAnswer2 & "/" & $sInputBoxAnswer2 & " misc.pdf") It creates a folder with company name then creates a folder with the id number as the name then copies and renames the xlsx file to the id number folder and so on... Am I makeing this to complicated? I just want to select if the script run one of the file moves or not... Link to comment Share on other sites More sharing options...
nivek Posted February 2, 2010 Author Share Posted February 2, 2010 Hey.. Thank you for all of your help... You Guys are than me.. This morning my changed his mind on how he wanted the program to work... YEA!!!! Thanks again, nivek PS: was still having trouble with the check boxes... 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