advance Posted January 15, 2005 Share Posted January 15, 2005 I know this might look weird, but this is what I have: #include <GuiConstants.au3> If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000 GuiCreate("Sync v2.0", 410, 138,(@DesktopWidth-410)/2, (@DesktopHeight-138)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) GuiCtrlCreateGroup("Source", 10, 0, 290, 50) GuiCtrlCreateGroup("Destination", 10, 70, 290, 50) GuiCtrlCreateButton("Go", 310, 6, 90, 114) $source = c:\source $dest = c:\dest DirCopy($source & $source\*.*,$dest & "$dest\*.*) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else ;;; EndSelect WEnd Exit I Want the GUI (the GUI is fine) to pop up, have the user imput the directories, click go, and then they will "sync" and then exit. I will probaly add a msg box popup, or if I knew how, I would rrecreate the copy dialog with the process bar. Link to comment Share on other sites More sharing options...
Xandl Posted January 15, 2005 Share Posted January 15, 2005 You basicly forgot the " around source/dest values: #include <GuiConstants.au3> If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000 GuiCreate("Sync v2.0", 410, 138,(@DesktopWidth-410)/2, (@DesktopHeight-138)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) GuiCtrlCreateGroup("Source", 10, 0, 290, 50) GuiCtrlCreateGroup("Destination", 10, 70, 290, 50) $go = GuiCtrlCreateButton("Go", 310, 6, 90, 114) $source = "c:\source" $dest = "c:\dest" GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $go do_copy() EndSelect WEnd Exit Func do_copy() DirCopy($source,$dest,1) EndFunc For the copy progress bar, you will have to sum up the sourc file count/or size, this is 100% for the progressbar. Then copy file per file, and increase the progressbar value after each successful copy. ciao Xandl Link to comment Share on other sites More sharing options...
advance Posted January 15, 2005 Author Share Posted January 15, 2005 I tried to add imput, and this is what I got: expandcollapse popup#include <GuiConstants.au3> If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000 GuiCreate("Sync v1.5", 392, 138,(@DesktopWidth-392)/2, (@DesktopHeight-138)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) $Group_S = GuiCtrlCreateGroup("Source", 10, 0, 290, 50) $Group_D = GuiCtrlCreateGroup("Destination", 10, 70, 290, 50) $go = GuiCtrlCreateButton("Go", 310, 6, 70, 114) $Input_D = GuiCtrlCreateInput("", 20, 20, 270, 20) $Input_S = GuiCtrlCreateInput("", 20, 90, 270, 20) $source = GUICtrlRead ($Input_S) $dest = GUICtrlRead ($Input_D) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $go read_sd() do_copy() EndSelect WEnd Exit Func read_sd() $source = GUICtrlRead ($Input_S) $dest = GUICtrlRead ($Input_D) EndFunc Func do_copy() DirCopy($source,$dest) EndFunc I tried adding a function, and it is still nto working. Help? Link to comment Share on other sites More sharing options...
Developers Jos Posted January 15, 2005 Developers Share Posted January 15, 2005 I tried to add imput, and this is what I got:-snip-I tried adding a function, and it is still nto working. Help?<{POST_SNAPBACK}>DirCopy works right ?What isn't working ? 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...
martin Posted January 15, 2005 Share Posted January 15, 2005 (edited) I tried to add imput, and this is what I got:#include <GuiConstants.au3> If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000 GuiCreate("Sync v1.5", 392, 138,(@DesktopWidth-392)/2, (@DesktopHeight-138)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) $Group_S = GuiCtrlCreateGroup("Source", 10, 0, 290, 50) $Group_D = GuiCtrlCreateGroup("Destination", 10, 70, 290, 50) $go = GuiCtrlCreateButton("Go", 310, 6, 70, 114) $Input_D = GuiCtrlCreateInput("", 20, 20, 270, 20) $Input_S = GuiCtrlCreateInput("", 20, 90, 270, 20) $source = GUICtrlRead ($Input_S) $dest = GUICtrlRead ($Input_D) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $go read_sd() do_copy() EndSelect WEnd Exit Func read_sd() $source = GUICtrlRead ($Input_S) $dest = GUICtrlRead ($Input_D) EndFunc Func do_copy() DirCopy($source,$dest,1);if you add ,1 it works - I think the documentation ;in the help is wrong. EndFuncI tried adding a function, and it is still nto working. Help?<{POST_SNAPBACK}> Edited January 15, 2005 by martin Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
martin Posted January 15, 2005 Share Posted January 15, 2005 I think maybe the documentation for DirCopy is wrong because if you try DirCopy($source,$dest,1) it will work. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
Nova Posted January 15, 2005 Share Posted January 15, 2005 (edited) If you try DirCopy($source,$dest,1) it will work.From help fileDirCopy ( "source dir", "dest dir" [, flag])Thats is the example in the helpfile, so how could it be wrong ? Edited January 15, 2005 by Nova Link to comment Share on other sites More sharing options...
advance Posted January 15, 2005 Author Share Posted January 15, 2005 even after that it dosnt work.. Link to comment Share on other sites More sharing options...
martin Posted January 16, 2005 Share Posted January 16, 2005 even after that it dosnt work..<{POST_SNAPBACK}> It worked for me so there must be something else wrong. See if DirCopy sets error to 1 (It must do I guess) in which case the directory you're inputting as the source might be wrong. Maybe you could try checking that the source really exists or use a drag and drop into the source input box so that you really get the path correct. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. 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