Post
by parkerthompson » Tue May 02, 2006 4:00 pm
I dumped the Windows script and added your 2 lines with some modification and got it to work.
The script is all over the place, but it works.
I think Macro Scheduler is a really great product.
I really appreciate the context sensitive help.
I remember the good old days using FoxPro 2.6 they had the same help system, until MS took them over and gaffed it.
Here it is, as it is not for the faint of heart or some one who actually programs.
Unfortunately I can't devote a lot of time to programming.
All it does is copy the contents of a camera and moves it to a network drive.
The foremen at our job sites are computer deficient, but then again I'm carpentry deficient.
Label>start
Let>a=0
Let>frompicture=E:\
Let>projectdrive=m:
Let>drive=Z
Let>q=1
Readln>c:\whichdir.txt,1,jobnumber
Readln>c:\cameradrive.txt,1,frompicture
Let>frompicturea= "
Concat>frompicturea,frompicture
Concat>frompicturea,"
Let>tojob=projectdrive
Concat>projectdrive,\
Concat>projectdrive,jobnumber
Concat>projectdrive,\
Let>file_names_count=0
Day>tday
Month>tmonth
Year>tyear
Let>Current=tmonth
Concat>Current,tday
Concat>Current,tyear
Let>blabla=GetAllSubFolders "E:\"
Remark>checks to see if drive is available.
If>Jobnumber=##NOFILE##,realstartjob
If>frompicture=##NOFILE##,edir
Goto>cameraloop
Label>changedrive
Input>newdrive,Drive Letter for Memory card or Camera I.E. e:\
Deletefile>c:\cameradrive.txt
Writeln>c:\cameradrive.txt,%newdrive%
Message>You'll need to restart program
goto>end
Label>cameraloop
readln>c:\cameradrive.txt,1,frompicture
Let>a=a+1
IfDirExists>frompicture,withinedir
Ask>If camera is not plugged in please do so now.,cameraplug
If>a=4,error
If>cameraplug=YES,cameraloop
Rem>File Count To Copy
Goto>withinedir
Let>q=1
Label>edir
Input>drive,Drive Letter?,E:\
Deletefile>c:\cameradrive.txt
Writeln>c:\cameradrive.txt,%drive%
Run>cmd /c dir %drive%*.* /ad /s /b > C:\thedrive.txt
Message>You'll need to restart program
Goto>end
Label>withinedir
Readln>C:\thedrive.txt,q,folder
If>folder=##EOF##,moreedir
Let>q=q+1
Goto>withinedir
Label>moreedir
Let>q=q-1
Readln>C:\thedrive.txt,q,folder
Concat>folder,\*.*
CountFiles>folder,file_names_count,0
Label>endedir
Label>Startdiag
Dialog>Dialog1
Caption=Please Check Drive and Job Number if incorrect press fix:
Width=445
Height=250
Top=170
Left=84
Max=1
Min=1
Close=1
Resize=1
Label=Drive to copy pictures from,136,32,true
Label=Project to copy pictures to,136,64,true
Label=Copy File Count,136,96,true
Label=Please review from location and to location if they look good press OK,72,136,true
Edit=msEdit1,296,24,121,%frompicture%
Edit=msEdit2,296,56,121,%projectdrive%
Button=OK,64,168,75,25,2
Button=Change Job,168,168,75,25,3
Edit=msEdit3,296,88,121,%file_names_count%
Button=Cancel,352,168,75,25,5
Button=Newdrive,264,168,75,25,4
EndDialog>Dialog1
Show>Dialog1,b
If>b=2,allgood
If>b=3,badstuff
If>b=4,edir
If>b=5,end
Label>badstuff
CloseDialog>Dialog1
Goto>realstartjob
Goto>end
Label>allgood
CloseDialog>Dialog1
let>movedos=copy
concat>movedos, "
concat>movedos,%folder%
concat>movedos,"
concat>movedos, "
concat>movedos,%projectdrive%
concat>movedos,photos\
concat>movedos,current
concat>movedos,"
let>makedir=md
concat>makedir, "
concat>makedir,%projectdrive%
concat>makedir,photos\
concat>makedir,current
concat>makedir,"
Run>cmd.exe /c %makedir%
Run>cmd.exe /c %movedos%
Goto>end
Label>error
Message>For some reason you camera or memory is not connected contact IT, or change the drive letter.
Goto>end
Label>realstartjob
Run>cmd.exe /c dir m:\ > m:\directory.txt
Let>COMSPEC=Cmd.exe
Deletefile>c:\testtextfile1.txt
Deletefile>c:\whichdir.txt
Let>c=7
Label>startjob
ReadLn>c:\testtextfile.txt,c,linejob
If>linejob=##EOF##,finishjob
If>linejob=,cleanlinejob
Midstr>linejob,40,200,somevaluejob
WriteLn>c:\testtextfile1.txt,somevaluejob
Label>cleanlinejob
Let>c=c+1
Goto>startjob
Label>finishjob
IfFileExists>c:\~list_script~.scp
DeleteFile>c:\~list_script~.scp
EndIf
Dialog>Dialog2
Caption=Click Ok to View a List of Available Jobs.
Width=445
Height=250
Top=100
Left=CENTER
Label=Click to see Available Jobs List,120,72
Button=See List,184,176,75,25,3
EndDialog>Dialog2
show>dialog2,d
if>d=3,Updatejob
if>d=2,exitjob
Wait>0.2
Macro>c:\~list_script~.scp
Let>list_result=list_var_%MACRO_RESULT%
rem>MDL>%list_result%
Writeln>c:\whichdir.txt,%list_result%
Wait>1
SRT>Updatejob
Let>e=0
//Change c:\testtextfile.txt in the line below to the file that contains your data list.
ReadFile>c:\testtextfile1.txt,listjob
Separate>listjob,%CRLF%,list_var
WriteLn>c:\~list_script~.scp,wresult,Dialog>DialogList
WriteLn>c:\~list_script~.scp,wresult,Caption=Pick from list
WriteLn>c:\~list_script~.scp,wresult,Width=400
WriteLn>c:\~list_script~.scp,wresult,Height=600
WriteLn>c:\~list_script~.scp,wresult,Top=100
WriteLn>c:\~list_script~.scp,wresult,Left=CENTER
Repeat>e
Let>e=e+1
Let>ypos=30*%e%
Let>bname=list_var_%e%
WriteLn>c:\~list_script~.scp,wresult,Button=%bname%,10,%ypos%,380,25,%e%
Until>e,list_var_count
WriteLn>c:\~list_script~.scp,wresult,EndDialog>DialogList
WriteLn>c:\~list_script~.scp,wresult,show>DialogList,MACRO_RESULT
WriteLn>c:\~list_script~.scp,wresult,CloseDialog>DialogList
END>Updatejob
Message>You'll need to restart program
Goto>end
Label>exitjob
Message>You'll need to restart program
Label>end