Code:
SourcePattern = C:\My Documents\List1.txt
DestPattern = D:\Main Backup\
FileCopy, %SourcePattern%, %DestPattern%
From what I see SourcePattern is a variable, I could not find it as a command, but may have missed it. Just to ascertain.
=================================
Main program in development: CONTROLLED FILE COPIER (not started)
MODULE IN DEVELOPMENT: FILE PATH CORRECTION / CONFIRMATION WINDOW
Questions:
1) How can I have and use more then one string input field before OK is to be pressed? Only the last one gets displayed to see. I need 4.
2) Input fields in GUI sections
2a) Why can vEditBox and %EditBox% not be replaced by a different variable name {vS_path, S_path}?
2b) Why can vFixEditBox and %FixEditBox% not be replaced by a different variable name {vD_path, D_path}?
3) Go: Go1, Go2, Go3 etc. Why is the first lot of lines without a "Go". There appears to be no subroutine call to Go2, Go3. Where can I learn about sructuring AHK?
4) Data Transfer from one to other variable. Why is this not happening when command is located before Return where there would be a "natural" location. Or how can I do the transfer before the next subroutine is called, to free the Entry-Field variable (vEditBox)
5) I received error message saying I can not use a variable twice (lines listed). The variable appeared only once in the program. Where was the second? Error eliminated without knowing what it really was.
________________
Code:
;Main Program, in development: _Controlled File Copier_
;Sub-Program: File directory handling / interface (Part of Preferences window)
;Author: Alias morphingstar
; Generated using SmartGUI Creator 3.5.1, edited in NoteTab.
;Next small goal: Open window Preferences, enable user to accept / correct 3 file directories using the OK-button.
;Micro-goals: Improve string handling as commented in this program.
;_________ Commands as recommended in forum
#NoEnv
#notrayicon
#SingleInstance force
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
;______
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. Added for convenience, not used for stated purpose.
;
;_________Variable data assignment
Editbox = G:\_workfiles\source
FixEditbox = G:\_workfiles\destination
;String handling to be added to replace drive G: by the AHK containing drive (e.g. SD card / USB_pen.
;_________Program start using GUI
;structure copied from http://www.autohotkey.com/forum/viewtopic.php?p=51911#51911
;Go0:
;Gui, 0:Submit
;
Gui, 1:Add, Text, x16 y7 w100 h30,(1)_Enter file source directory
;Gui, 1:Add, Edit, x136 y7 w200 h30 vEditbox, G:\_workfiles\source
Gui, 1:Add, Edit, x136 y7 w200 h30 vEditbox, %Editbox%
; Is _Editbox_ a command AND a variable? Prg turned bad when EDITBOX was replaced by S_path.
Gui, 1:Add, Button, gGo1 x16 y57 w100 h30,Go
; Note the Go1 versus Go2, is this a variable than can not be used twice?
Gui, 1:Add, Button, x136 y57 w100 h30,Cancel
Gui, Show, x158 y110 h107 w358, 1 Window Top ez using ;SmartGUI Creator 3.5.1
;FileSourceDir = %Editbox%
Return
;Go2:
;Gui, 2:Submit
Go1:
Gui, 1:Submit
Gui, 2:Add, Text, x16 y7 w100 h30,Confirm or change file Destination
;Gui, 2:Add, Edit, x136 y7 w200 h30 vFixEditbox, G:\_workfiles\destination
Gui, 2:Add, Edit, x136 y7 w200 h30 vFixEditbox, %FixEditbox%
; Is _FixEditbox_ a command AND a variable? Prg turned bad when FIXEDITBOX was replaced by D_path.
Gui, 2:Add, Button, gGo2 x16 y57 w100 h30,Go
; Note the Go2 versus Go1, is this a variable than can not be used twice?
Gui, 2:Add, Button, x136 y57 w100 h30,Cancel
Gui, 2:Show, x158 y110 h107 w358, 2 Window Top ez using SmartGUI Creator 3.5.1
;FileDestDir = %FixEditbox%
return
;Go3:
Go2:
Gui, 2:Submit
;_____________ variable data transfer / copy (purpose: test operation)
FileSourceDir = %Editbox%
FileDestDir = %FixEditbox%
msgbox, FROM %filesourcedir% TO %FileDestDir% -Full path %A_ScriptDir%
;Chr$(13) won't CR
return
Cancel:
Gui, Cancel
return
;Killing variable content for this program because of supposed double use
FixEditbox = ""
Editbox = ""
FileSourceDir = ""
FileDestDir = ""
return
ExitApp
thanks