Hello,
I'm trying to use Macro Scheduler to automate processing of a series of files. I've been able to put together a script that handles the processing, but I'm confused about how to
1) Input the paths of a number of files (say, 6) as a list;
2) Get MS to process all of the files in sequence.
As I said, my script automates the processing of one file without problems. It's the multiple files bit I can't do. I'm sure the procedure would involve an array, but I'm not clear on how to use these in Macro Scheduler.
I'd appreciate any help offered by the experienced people on this list.
Newbie help - batch processing
Moderators: JRL, Dorian (MJT support)
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
As far as I can tell, GetFileList> deals only with a set of files which are already in the same directory. What I'd like to be able to do is select files from different locations using Input>, Browse, then get my script to process them all individually in sequence.bob hansen wrote:Sorry, but you found it.....look at GetFileList> samples, it also includes the Repeat> command.
Use the Repeat> / Unitl> approach with almost all other commands. Could be CopyFile>, DeleteFile, etc.
Code: Select all
Let>lc=0
Label>Request
Input>Res,Please select file to copy ...
If>Res=,Ask
WLN>C:\Paths.txt,Result,%Res%
Label>Ask
Ask>Another file?,Answer
If>Answer=YES,Request
Label>Copier
Add>lc,1
ReadLN>C:\Paths.txt,%lc%,FileToCopy
If>FileToCopy=##EOF##,End
Message>Copy file now:%CRLF%%FileToCopy%
Wait>1.5
Run Program>cmd /c copy %FileToCopy%
Goto>Copier
Label>End
Del>C:\Paths.txt
Let>sep=;
ConCat>Paths,%sep%%Res%
to create a single string variable: C:\test1;C:\test2;C:\test3
which could have been splitted afterwards ...
Lumumba,
That's just what I was looking for. I've made some modifications to your code to suit what I'm doing, and it works exactly as I'd hoped. Thank you. It's obvious - now that someone else has shown me!
Note to anyone else who cuts and pastes the code: remove spaces at the end of each line. That had me confused for a while.
That's just what I was looking for. I've made some modifications to your code to suit what I'm doing, and it works exactly as I'd hoped. Thank you. It's obvious - now that someone else has shown me!
Note to anyone else who cuts and pastes the code: remove spaces at the end of each line. That had me confused for a while.