Raluvian Posted May 24, 2006 Share Posted May 24, 2006 im not very good with autoit3 so i am going to post my last post asking that maybe one of you could make a scipt i was trying to make. it has supposed to read a directory for folders and list the folders in a list and when you press a button it gave it to the ini for storage. then when the user pressed another button it would read the ini for all the folders there and take the subdirectorys and add them to another folder. thank you for all your support and findness if anyone makes this i would be very pleased. Link to comment Share on other sites More sharing options...
SpookMeister Posted May 24, 2006 Share Posted May 24, 2006 You know, its by actually doing stuff like this that you become "good" with autoit3. Give it a shot, one step at a time and ask for help while your working on it. You will get a lot more assistance that way. [u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote] Link to comment Share on other sites More sharing options...
ChrisL Posted May 24, 2006 Share Posted May 24, 2006 This will get you going, only minimun error checking in it though, use the beta version of autoit! expandcollapse popup#include <Array.au3> Dim $aList[1] #include <GuiConstants.au3> GuiCreate("MyGUI", 392, 710,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $Input_Dir = GuiCtrlCreateInput("", 20, 20, 240, 20) $Browse = GuiCtrlCreateButton("Browse", 280, 20, 90, 20) $Edit = GuiCtrlCreateEdit("", 20, 60, 350, 560) $Go = GuiCtrlCreateButton("Go", 40, 650, 150, 40) $Save = GuiCtrlCreateButton("Save", 220, 650, 140, 40) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Browse $folder = FileSelectFolder( "Please select the folder to update","d:\","","Customise") GUICtrlSetData($Input_Dir, $Folder) Case $msg = $Go If GuiCtrlRead ($input_Dir) <> "" and FileExists(GuiCtrlRead ($input_Dir)) Then SplashTexton ("Dir Search", "Wait Searching", 220, 50) Search(GuiCtrlRead ($input_Dir)) SplashOff() If Ubound ($aList) -1 = 0 then Msgbox (0,"Error", "No directories found") For $i = 1 to Ubound ($aList) -1 GUICtrlSetData ($Edit, $aList[$i] & @CRLF,1) Next Endif Case $msg = $Save If GuiCtrlRead ($input_Dir) <> "" then $FileSave = FileSaveDialog ("Save to", @desktopDir, "Config file (*.ini)", 2) If $FileSave <> "" then If StringRight( $FileSave, 4) <> ".ini" then $FileSave = $FileSave & ".ini" $file = FileOpen($FileSave, 1) FileWriteLine ($file ,"[" & GuiCtrlRead ($input_Dir) & "]") For $i = 1 to Ubound ($aList) -1 FileWriteLine ($file , $i & "=" & $aList[$i]) Next FileClose ($file) msgBox (0,"Saved", "File saved to " & $FileSave) EndIf Endif Case Else ;;; EndSelect WEnd Exit Func Search($current) Local $search = FileFindFirstFile($current & "\*.*") While 1 Dim $file = FileFindNextFile($search) If @error Or StringLen($file) < 1 Then ExitLoop If StringInStr(FileGetAttrib($current & "\" & $file), "D") And ($file <> "." Or $file <> "..") Then _ArrayAdd ($aList,$current & "\" & $file) Search($current & "\" & $file) EndIf WEnd FileClose($search) EndFunc [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
Raluvian Posted May 25, 2006 Author Share Posted May 25, 2006 (edited) spook...i did ask for help and i got no help once so ever.. and ChrisL do you have an aol or msn or yahoo? Edited May 25, 2006 by Raluvian Link to comment Share on other sites More sharing options...
unclefishy Posted May 25, 2006 Share Posted May 25, 2006 when you say use the beta version... can i get by using "beta compile" or what exactly are you refering to... I have seen this a lot and am not sure :-/ Link to comment Share on other sites More sharing options...
exodius Posted May 25, 2006 Share Posted May 25, 2006 when you say use the beta version...can i get by using "beta compile"or what exactly are you refering to... I have seen this a lot and am not sure :-/When someone says "use the beta version", they mean have the AutoIt3 Beta installed and in SciTE you can run the script using the the AutoIt Beta by either selecting "Beta Run" from "Tools" or pressing Alt+F5... Or you can compile by pressing Alt+F7. Link to comment Share on other sites More sharing options...
ChrisL Posted May 25, 2006 Share Posted May 25, 2006 spook...i did ask for help and i got no help once so ever..and ChrisL do you have an aol or msn or yahoo?only that I use for work, post your questions here I'm sure others can answer them as well as me [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
Raluvian Posted May 25, 2006 Author Share Posted May 25, 2006 How do i add exclusion to that script?? like exclusion of the folder -modcache? Link to comment Share on other sites More sharing options...
ChrisL Posted May 25, 2006 Share Posted May 25, 2006 See the $excludelist line, put the folders in seperated by commas If you add a folder to the list it will be ignored totally and so will the sub directories expandcollapse popup#include <Array.au3> Dim $aList[1] $excludeList = "bitmaps800,greenscreen" $excArray = Stringsplit ($excludelist, ",") #include <GuiConstants.au3> GuiCreate("MyGUI", 392, 710,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $Input_Dir = GuiCtrlCreateInput("", 20, 20, 240, 20) $Browse = GuiCtrlCreateButton("Browse", 280, 20, 90, 20) $Edit = GuiCtrlCreateEdit("", 20, 60, 350, 560) $Go = GuiCtrlCreateButton("Go", 40, 650, 150, 40) $Save = GuiCtrlCreateButton("Save", 220, 650, 140, 40) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Browse $folder = FileSelectFolder( "Please select the folder to update","d:\","","Customise") GUICtrlSetData($Input_Dir, $Folder) Case $msg = $Go If GuiCtrlRead ($input_Dir) <> "" and FileExists(GuiCtrlRead ($input_Dir)) Then SplashTexton ("Dir Search", "Wait Searching", 220, 50) Search(GuiCtrlRead ($input_Dir)) SplashOff() If Ubound ($aList) -1 = 0 then Msgbox (0,"Error", "No directories found") For $i = 1 to Ubound ($aList) -1 GUICtrlSetData ($Edit, $aList[$i] & @CRLF,1) Next Endif Case $msg = $Save If GuiCtrlRead ($input_Dir) <> "" then $FileSave = FileSaveDialog ("Save to", @desktopDir, "Config file (*.ini)", 2) If $FileSave <> "" then If StringRight( $FileSave, 4) <> ".ini" then $FileSave = $FileSave & ".ini" $file = FileOpen($FileSave, 1) FileWriteLine ($file ,"[" & GuiCtrlRead ($input_Dir) & "]") For $i = 1 to Ubound ($aList) -1 FileWriteLine ($file , $i & "=" & $aList[$i]) Next FileClose ($file) msgBox (0,"Saved", "File saved to " & $FileSave) EndIf Endif Case Else ;;; EndSelect WEnd Exit Func Search($current) Local $search = FileFindFirstFile($current & "\*.*") While 1 Dim $file = FileFindNextFile($search) If @error Or StringLen($file) < 1 Then ExitLoop If StringInStr(FileGetAttrib($current & "\" & $file), "D") And ($file <> "." Or $file <> "..") Then $Skip = 0 For $i = 1 to Ubound ($excArray) - 1 If $file = $excArray[$i] then $skip = 1 Next If $Skip <> 1 then _ArrayAdd ($aList,$current & "\" & $file) Search($current & "\" & $file) EndIf EndIf WEnd FileClose($search) EndFunc [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
Raluvian Posted May 25, 2006 Author Share Posted May 25, 2006 i have been looking at the help file and i don't see anything about short list names. so its not d:\...\...\...\...\... so its just one subdirectory and thats it. so like i have a folder called sureyaright in d:\woot\games\awesome so it only reads that subdirectory and nothing further, or would i have to exclude all thouse? Link to comment Share on other sites More sharing options...
ChrisL Posted May 26, 2006 Share Posted May 26, 2006 i have been looking at the help file and i don't see anything about short list names. so its not d:\...\...\...\...\...so its just one subdirectory and thats it. so like i have a folder called sureyaright in d:\woot\games\awesomeso it only reads that subdirectory and nothing further, or would i have to exclude all thouse?Not sure I understand what you mean [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
Raluvian Posted May 26, 2006 Author Share Posted May 26, 2006 (edited) Not sure I understand what you mean i mean like it only shows a certain level of subdirectorys Edited May 26, 2006 by Raluvian Link to comment Share on other sites More sharing options...
ChrisL Posted May 26, 2006 Share Posted May 26, 2006 i mean like it only shows a certain level of subdirectorysOK if you had a path ofC:\Dir1\Dir2\Dir3\Dir4\Dir5\Dir6\Dir7If you put Dir4 in the exclude list then Dir4 will be ignored and so will the subdirectories 5,6 and 7 in the last code I posted [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
Raluvian Posted May 26, 2006 Author Share Posted May 26, 2006 (edited) like how would i shortain what it shows in the text box? like... it shows d:\dir\dir\dir\dir i only want to it shortain the text to just a certain directory instead of that just have it just a \dir\ show up Edited May 26, 2006 by Raluvian Link to comment Share on other sites More sharing options...
ChrisL Posted May 26, 2006 Share Posted May 26, 2006 like how would i shortain what it shows in the text box? like... it shows d:\dir\dir\dir\dir i only want to it shortain the text to just a certain directory instead of that just have it just a \dir\ show up Like this? $showfullPath = 0 list the Directory names without the full path $showFullPath = 1 List the full path expandcollapse popup#include <Array.au3> Dim $aList[1] $ShowFullPath = 0 $excludeList = "bitmaps800,greenscreen" $excArray = Stringsplit ($excludelist, ",") #include <GuiConstants.au3> GuiCreate("MyGUI", 392, 710,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $Input_Dir = GuiCtrlCreateInput("", 20, 20, 240, 20) $Browse = GuiCtrlCreateButton("Browse", 280, 20, 90, 20) $Edit = GuiCtrlCreateEdit("", 20, 60, 350, 560) $Go = GuiCtrlCreateButton("Go", 40, 650, 150, 40) $Save = GuiCtrlCreateButton("Save", 220, 650, 140, 40) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Browse $folder = FileSelectFolder( "Please select the folder to update","d:\","","Customise") GUICtrlSetData($Input_Dir, $Folder) Case $msg = $Go If GuiCtrlRead ($input_Dir) <> "" and FileExists(GuiCtrlRead ($input_Dir)) Then SplashTexton ("Dir Search", "Wait Searching", 220, 50) Search(GuiCtrlRead ($input_Dir)) SplashOff() If Ubound ($aList) -1 = 0 then Msgbox (0,"Error", "No directories found") For $i = 1 to Ubound ($aList) -1 GUICtrlSetData ($Edit, $aList[$i] & @CRLF,1) Next Endif Case $msg = $Save If GuiCtrlRead ($input_Dir) <> "" then $FileSave = FileSaveDialog ("Save to", @desktopDir, "Config file (*.ini)", 2) If $FileSave <> "" then If StringRight( $FileSave, 4) <> ".ini" then $FileSave = $FileSave & ".ini" $file = FileOpen($FileSave, 1) FileWriteLine ($file ,"[" & GuiCtrlRead ($input_Dir) & "]") For $i = 1 to Ubound ($aList) -1 FileWriteLine ($file , $i & "=" & $aList[$i]) Next FileClose ($file) msgBox (0,"Saved", "File saved to " & $FileSave) EndIf Endif Case Else ;;; EndSelect WEnd Exit Func Search($current) Local $search = FileFindFirstFile($current & "\*.*") While 1 Dim $file = FileFindNextFile($search) If @error Or StringLen($file) < 1 Then ExitLoop If StringInStr(FileGetAttrib($current & "\" & $file), "D") And ($file <> "." Or $file <> "..") Then $Skip = 0 For $i = 1 to Ubound ($excArray) - 1 If $file = $excArray[$i] then $skip = 1 Next If $Skip <> 1 then If $showfullpath = 1 then _ArrayAdd ($aList,$current & "\" & $file) Else _ArrayAdd ($aList,$file) Endif Search($current & "\" & $file) EndIf EndIf WEnd FileClose($search) EndFunc [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
Raluvian Posted May 26, 2006 Author Share Posted May 26, 2006 i am not sure im at the high school computer right now so when i get back to my pc i will. Link to comment Share on other sites More sharing options...
Raluvian Posted May 26, 2006 Author Share Posted May 26, 2006 (edited) that worked perfectly, i also changed the box where the dirs are displayed to a list so that i can try to find a way so i can click a dir and press a putton and it saves t to an ini and to be later used in a mass dirmove Edited May 26, 2006 by Raluvian Link to comment Share on other sites More sharing options...
Raluvian Posted May 27, 2006 Author Share Posted May 27, 2006 do you know how to make this so in my past post? so its easily pluged into that scipt and runs? i tryed to get it working but nothing 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