Sign in to follow this  
Followers 0
Graham Jackson

A bit of advice please

5 posts in this topic

It's all a bit new to me and I'm struggling to get my head round some of the basics.

Could some kind soul make an old man very happy please :D

I'm wanting to copy a number of files automatically from one location to another using a button. Sounds simple? Well here's the other bit I can't figure out. I have a number of files in different directories - selection of the source is by a drop down box - the destination for the files is the same.

I'm not asking for a script (altho that would be very nice) but if someone can give me an idea of the commands and the way I should structure this please.

Thanks for reading - hope someone can help :D

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

It's all a bit new to me and I'm struggling to get my head round some of the basics.

Could some kind soul make an old man very happy please :D

I'm wanting to copy a number of files automatically from one location to another using a button. Sounds simple? Well here's the other bit I can't figure out. I have a number of files in different directories - selection of the source is by a drop down box - the destination for the files is the same.

I'm not asking for a script (altho that would be very nice) but if someone can give me an idea of the commands and the way I should structure this please.

Thanks for reading - hope someone can help :D

I recomend getting SciTE and using the GUI builder that comes with the program, then you just have to configure the buttons/comboboxes

Check the helpfile that comes with autoit 3 (wonderful thing) or this site

http://www.autoitscripts.com/autoit3/docs/

for more info on what your looking for

Edited by Paulie

Share this post


Link to post
Share on other sites

try this

#include <GUIConstants.au3>
; == GUI generated with Koda ==
$GUI = GUICreate("Copier", 245, 112, 192, 125)
$File = GUICtrlCreateCombo("", 48, 16, 81, 21)
GUICtrlCreateLabel("File", 16, 16, 20, 17)
$browse = GUICtrlCreateButton("Browse", 144, 16, 73, 17)
GUICtrlCreateLabel("Copy to", 0, 48, 40, 17)
$to = GUICtrlCreateCombo("", 48, 48, 81, 21)
$browse2 = GUICtrlCreateButton("Browse", 144, 48, 73, 17)
$copy = GUICtrlCreateButton("Copy", 88, 80, 57, 25)
GUISetState(@SW_SHOW)
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $browse
            GUICtrlSetData($File,FileOpenDialog("Select a file","","Files(*.*)"))
        Case $msg = $browse2
            GUICtrlSetData($to,FileSelectFolder("Select Folder",""))
        Case $msg = $copy
            If GUICtrlRead($File) = "" or GUICtrlRead($to) = "" Then
                MsgBox(0,"Error","Choose a file or a destination")
            Else
                FileCopy(GUICtrlRead($File),GUICtrlRead($to))
                MsgBox(0,"Complete","File Copied Completely")
            EndIf
        Case $msg = $GUI_EVENT_CLOSE
            Exit
    EndSelect
WEnd

Share this post


Link to post
Share on other sites

Wow - super fast reply you guys. Thanks for the suggestions - I think I might even be seeing a bit of light at the end of the tunnel now.

Best.

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