open files in spec. folder and execute script

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
sjswart
Newbie
Posts: 1
Joined: Thu Sep 27, 2007 8:21 am

open files in spec. folder and execute script

Post by sjswart » Thu Sep 27, 2007 9:12 am

Hi there
I'm looking for a way to open files in a spec. folder sequentially
and, after a file is opened, run a script on it. (the script is for all files the same)

lets say i have 3 txt files in a folder (a.txt, b.txt and c.txt)
i want the script to open

a.txt => run script => close a.txt
b.txt => run script => close b.txt
c.txt => run script => close c.txt

and this for all the files in the spec. folder

hope some1 can help me! :P

adroege
Automation Wizard
Posts: 438
Joined: Tue Dec 07, 2004 7:39 pm

Post by adroege » Wed Jun 02, 2010 10:35 pm

Code: Select all


Let>myFolderName=temp

GetFileList>c:\%myFolderName%\*.txt,files
Separate>files,;,file_names
MessageModal>Num Files: %file_names_count%
If>file_names_count=0,Exit

Let>k=0
Repeat>k
 Let>k=k+1
 Message>file_names_%k%
 //
 //Run your macro code here
 //
Until>k,file_names_count

Label>Exit



Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts