logonui Posted May 17, 2007 Posted May 17, 2007 I have been trying to write a script that sets up a new RIS image for updating. #include <GuiConstants.au3> $Version = "0.1" GuiCreate("RIS Image Creator v" & $Version, 270, 104,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $DestinationLabel = GuiCtrlCreateLabel("Destination Folder Name", 10, 10, 120, 20) $$DestinationInput = GuiCtrlCreateInput("", 10, 30, 250, 20) $OK = GuiCtrlCreateButton("&OK", 20, 60, 110, 30) $Cancel = GuiCtrlCreateButton("&Cancel", 140, 60, 110, 30) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Cancel ExitLoop Case $msg = $OK DirCreate("E:\RIS\RemoteInstall\Setup\English\Images\" & $DestinationInput) DirCopy("E:\RIS\RemoteInstall\Setup\English\Images\WinXPProSP2Basic","E:\RIS\RemoteInstall\Setup\English\Images\" & $DestinationInput,9) FileCopy("E:\RIS\RISFiles\XPProBasic\WIN51*","E:\RIS\RemoteInstall\Setup\English\Images\" & $DestinationInput,9) MsgBox(64,"RIS Image Creator","Image completed successfully") EndSelect WEnd Exit Does anybody know how to pull the information from the input box because the only output i am getting from it at the moment is "4" Thanks in advance for your help Lee
November Posted May 17, 2007 Posted May 17, 2007 I have been trying to write a script that sets up a new RIS image for updating. #include <GuiConstants.au3> $Version = "0.1" GuiCreate("RIS Image Creator v" & $Version, 270, 104,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $DestinationLabel = GuiCtrlCreateLabel("Destination Folder Name", 10, 10, 120, 20) $$DestinationInput = GuiCtrlCreateInput("", 10, 30, 250, 20) $OK = GuiCtrlCreateButton("&OK", 20, 60, 110, 30) $Cancel = GuiCtrlCreateButton("&Cancel", 140, 60, 110, 30) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Cancel ExitLoop Case $msg = $OK DirCreate("E:\RIS\RemoteInstall\Setup\English\Images\" & $DestinationInput) DirCopy("E:\RIS\RemoteInstall\Setup\English\Images\WinXPProSP2Basic","E:\RIS\RemoteInstall\Setup\English\Images\" & $DestinationInput,9) FileCopy("E:\RIS\RISFiles\XPProBasic\WIN51*","E:\RIS\RemoteInstall\Setup\English\Images\" & $DestinationInput,9) MsgBox(64,"RIS Image Creator","Image completed successfully") EndSelect WEnd Exit Does anybody know how to pull the information from the input box because the only output i am getting from it at the moment is "4" Thanks in advance for your help Lee Hi there... try this: $readinput = GUICtrlRead($DestinationInput) Cheers Old Scriptology Visual Ping 1.8 - Mass Ping Program with export to txt delimited. Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code. Desktop 2 RGB - Pick a color in the desktop and get the RGB code. ShootIT 1.0 - Screen Capture full and partial screen [font="'Arial Black';"]Remember Remember The Fifth of November.[/font]
xcal Posted May 17, 2007 Posted May 17, 2007 (edited) The 4 you're getting is the input's handle. Try GuiCtrlRead($DestinationInput). edit - november beat me to it. Edited May 17, 2007 by xcal How To Ask Questions The Smart Way
Helge Posted May 17, 2007 Posted May 17, 2007 (edited) Return Value : Returns the identifier (controlID) of the new control. ... To obtain the value of the control see GUICtrlRead.So... GUICtrlRead($DestinationInput) Btw, you have a extra dollar-sign in front of the $$DestinationInput on line 8. Also, code in autoit-tags are easier to read than code in code-tags. Edit : heh Edited May 17, 2007 by Helge
November Posted May 17, 2007 Posted May 17, 2007 The 4 you're getting is the input's handle. Try GuiCtrlRead($DestinationInput).edit - november beat me to it. LOLThe important thing its to help...Cheers m8 Old Scriptology Visual Ping 1.8 - Mass Ping Program with export to txt delimited. Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code. Desktop 2 RGB - Pick a color in the desktop and get the RGB code. ShootIT 1.0 - Screen Capture full and partial screen [font="'Arial Black';"]Remember Remember The Fifth of November.[/font]
logonui Posted May 17, 2007 Author Posted May 17, 2007 (edited) Hi there...try this:$readinput = GUICtrlRead($DestinationInput)CheersI inserted this into the code and it has gotten rid of the number but the info that i type into the input box still isn't found (just outputing "")EDIT: I noticed the $$ entry just after i posted. Cheers anyway Edited May 17, 2007 by logonui
PsaltyDS Posted May 17, 2007 Posted May 17, 2007 You didn't post how or where you made the change. This works for me: #include <GuiConstants.au3> $Version = "0.1" GUICreate("RIS Image Creator v" & $Version, 270, 104, -1, -1, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $DestinationLabel = GUICtrlCreateLabel("Destination Folder Name", 10, 10, 120, 20) $DestinationInput = GUICtrlCreateInput("", 10, 30, 250, 20) $OK = GUICtrlCreateButton("&OK", 20, 60, 110, 30) $Cancel = GUICtrlCreateButton("&Cancel", 140, 60, 110, 30) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $Cancel ExitLoop Case $OK $sInput = GUICtrlRead($DestinationInput) MsgBox(64, "RIS Image Creator", "Input is: " & $sInput) EndSwitch WEnd ExitoÝ÷ ز)Ü{*.j·¨ zÛb¢W^®rnaz¼"¶ayˬ¶PëÉ«¢+ØÀÌØíÍÕ±ÐôÅÕ½ÐíèÀäÈíQµÀÅÕ½Ðì(ÀÌØí͹ÍÝÈô¥±M±Ñ½±È ÅÕ½ÐíI%L%µ ÉѽȴM±Ð½±ÈÅÕ½Ðì°ÅÕ½ÐìÅÕ½Ðì°Ü°ÀÌØíÍձФ)5Í ½à ØаÅÕ½ÐíIÍÕ±ÐÅÕ½Ðì°ÅÕ½Ðí¹ÍÝÈÝÌèÅÕ½ÐìµÀìÀÌØí͹ÍÝȤ Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
logonui Posted May 18, 2007 Author Posted May 18, 2007 You didn't post how or where you made the change. This works for me: #include <GuiConstants.au3> $Version = "0.1" GUICreate("RIS Image Creator v" & $Version, 270, 104, -1, -1, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $DestinationLabel = GUICtrlCreateLabel("Destination Folder Name", 10, 10, 120, 20) $DestinationInput = GUICtrlCreateInput("", 10, 30, 250, 20) $OK = GUICtrlCreateButton("&OK", 20, 60, 110, 30) $Cancel = GUICtrlCreateButton("&Cancel", 140, 60, 110, 30) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $Cancel ExitLoop Case $OK $sInput = GUICtrlRead($DestinationInput) MsgBox(64, "RIS Image Creator", "Input is: " & $sInput) EndSwitch WEnd ExitoÝ÷ ز)Ü{*.j·¨ zÛb¢W^®rnaz¼"¶ayˬ¶PëÉ«¢+ØÀÌØíÍÕ±ÐôÅÕ½ÐíèÀäÈíQµÀÅÕ½Ðì(ÀÌØí͹ÍÝÈô¥±M±Ñ½±È ÅÕ½ÐíI%L%µ ÉѽȴM±Ð½±ÈÅÕ½Ðì°ÅÕ½ÐìÅÕ½Ðì°Ü°ÀÌØíÍձФ)5Í ½à ØаÅÕ½ÐíIÍÕ±ÐÅÕ½Ðì°ÅÕ½Ðí¹ÍÝÈÝÌèÅÕ½ÐìµÀìÀÌØí͹ÍÝȤ Cheers everyone it works now, The second way is good but i dont want the users to be able to save in a new location as it is it all stays standard
logonui Posted May 18, 2007 Author Posted May 18, 2007 (edited) I now have a new problem. I have tried to insert a progress bar while the files are being copied but i am getting an error message saying "EndSwitch" statement with no matching "Switch" statement This is my code now #include <GuiConstants.au3> $Version = "0.1" $FolderTemplate = "WinXPProSP2_" GUICreate("RIS Image Creator v" & $Version, 270, 104, -1, -1, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $DestinationLabel = GUICtrlCreateLabel("Folder Creation Date eg May2007/June2007", 10, 10, 260, 20) $DestinationInput = GUICtrlCreateInput("", 10, 30, 250, 20) $OK = GUICtrlCreateButton("&OK", 20, 60, 110, 30) $Cancel = GUICtrlCreateButton("&Cancel", 140, 60, 110, 30) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $Cancel ExitLoop Case $OK $sInput = GUICtrlRead($DestinationInput) ;MsgBox(64, "RIS Image Creator TEST", "Input is: " & $FolderTemplate & $sInput) ProgressOn("RIS Image Creator","Percent Completed","0%") For $i = 1 to 100 step 1 sleep(1000) ProgressSet($i,$i & " Percent") DirCreate("E:\RIS\RemoteInstall\Setup\English\Images\" & $FolderTemplate & $sInput) DirCopy("E:\RIS\RemoteInstall\Setup\English\Images\WinXPProSP2Basic","E:\RIS\RemoteInstall\Setup\English\Images\" & $FolderTemplate & $sInput,9) FileCopy("E:\RIS\RISFiles\XPProBasic\WIN51*","E:\RIS\RemoteInstall\Setup\English\Images\" & $FolderTemplate & $sInput,9) ProgressSet(100,"Done","Complete") sleep(500) ProgressOff() MsgBox(64,"RIS Image Creator","Image completed successfully") EndSwitch WEnd Exit Any Ideas??? Edited May 18, 2007 by logonui
Developers Jos Posted May 18, 2007 Developers Posted May 18, 2007 (edited) Tidy output .... does that help ? $Version = "0.1" $FolderTemplate = "WinXPProSP2_" GUICreate("RIS Image Creator v" & $Version, 270, 104, -1, -1, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $DestinationLabel = GUICtrlCreateLabel("Folder Creation Date eg May2007/June2007", 10, 10, 260, 20) $DestinationInput = GUICtrlCreateInput("", 10, 30, 250, 20) $OK = GUICtrlCreateButton("&OK", 20, 60, 110, 30) $Cancel = GUICtrlCreateButton("&Cancel", 140, 60, 110, 30) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $Cancel ExitLoop Case $OK $sInput = GUICtrlRead($DestinationInput) ;MsgBox(64, "RIS Image Creator TEST", "Input is: " & $FolderTemplate & $sInput) ProgressOn("RIS Image Creator", "Percent Completed", "0%") For $i = 1 To 100 Step 1 Sleep(1000) ProgressSet($i, $i & " Percent") DirCreate("E:\RIS\RemoteInstall\Setup\English\Images\" & $FolderTemplate & $sInput) DirCopy("E:\RIS\RemoteInstall\Setup\English\Images\WinXPProSP2Basic", "E:\RIS\RemoteInstall\Setup\English\Images\" & $FolderTemplate & $sInput, 9) FileCopy("E:\RIS\RISFiles\XPProBasic\WIN51*", "E:\RIS\RemoteInstall\Setup\English\Images\" & $FolderTemplate & $sInput, 9) ProgressSet(100, "Done", "Complete") Sleep(500) ProgressOff() MsgBox(64, "RIS Image Creator", "Image completed successfully") ;### Tidy Error -> "endswitch" is closing previous "case" EndSwitch ;### Tidy Error -> "wend" is closing previous "switch" WEnd Exit Edited May 18, 2007 by JdeB 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.
logonui Posted May 18, 2007 Author Posted May 18, 2007 Tidy output .... does that help ? $Version = "0.1" $FolderTemplate = "WinXPProSP2_" GUICreate("RIS Image Creator v" & $Version, 270, 104, -1, -1, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $DestinationLabel = GUICtrlCreateLabel("Folder Creation Date eg May2007/June2007", 10, 10, 260, 20) $DestinationInput = GUICtrlCreateInput("", 10, 30, 250, 20) $OK = GUICtrlCreateButton("&OK", 20, 60, 110, 30) $Cancel = GUICtrlCreateButton("&Cancel", 140, 60, 110, 30) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $Cancel ExitLoop Case $OK $sInput = GUICtrlRead($DestinationInput) ;MsgBox(64, "RIS Image Creator TEST", "Input is: " & $FolderTemplate & $sInput) ProgressOn("RIS Image Creator", "Percent Completed", "0%") For $i = 1 To 100 Step 1 Sleep(1000) ProgressSet($i, $i & " Percent") DirCreate("E:\RIS\RemoteInstall\Setup\English\Images\" & $FolderTemplate & $sInput) DirCopy("E:\RIS\RemoteInstall\Setup\English\Images\WinXPProSP2Basic", "E:\RIS\RemoteInstall\Setup\English\Images\" & $FolderTemplate & $sInput, 9) FileCopy("E:\RIS\RISFiles\XPProBasic\WIN51*", "E:\RIS\RemoteInstall\Setup\English\Images\" & $FolderTemplate & $sInput, 9) ProgressSet(100, "Done", "Complete") Sleep(500) ProgressOff() MsgBox(64, "RIS Image Creator", "Image completed successfully") ;### Tidy Error -> "endswitch" is closing previous "case" EndSwitch ;### Tidy Error -> "wend" is closing previous "switch" WEnd Exit nope, I am still getting the same message
Developers Jos Posted May 18, 2007 Developers Posted May 18, 2007 (edited) nope, I am still getting the same messagesure... the Tidy output shows your the problem area .... if you look closely then you see now that you are missing a Next before the EndSwitch . Edited May 18, 2007 by JdeB 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.
PsaltyDS Posted May 18, 2007 Posted May 18, 2007 sure... the Tidy output shows you the problem area .... if you look closely then you see now that you are missing a Next before the EndSwitch . In logonui's defense...the Tidy error was misleading. It should have said something like: ;### Tidy Error -> "endswitch" is closing previous "For" There is nothing wrong with EndSwitch closing a Case. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Developers Jos Posted May 18, 2007 Developers Posted May 18, 2007 (edited) There is nothing wrong with EndSwitch closing a Case.There is a problem with that in Tidy's opinion, EndSelect must close and Select.The issue is that EndSelect goes 2 Indent levels back, not one, and Tidy reports issues on the same Indent level.Also the output produced does show the error line and should help to understand what the error is about . Edited May 18, 2007 by JdeB 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.
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