|
Post by Rambo-X on Nov 29, 2020 1:04:36 GMT
Hello Everybody, Good Morning to you all Can I kindly know if all mmmacro files on a Folder can be played one after the other in some similar fashion like below code? The Reason is that I have like 200 Files on a Folder and they just can keep running one after the other without having to specifically add each file individually. I remove and add many files to it and having to rename the codes and stuff can become exhausting at times. 1 | FOR | EACH | FILE IN -R | D:\Macro\TX | DO 2 | RUN ACTION | RUN MACRO INLINE 3 | FOR | NEXT Thank you.
|
|
|
Post by Steve on Dec 5, 2020 1:05:12 GMT
Hi Rambo-X For this id use FOR EACH FILE IN with FOR EACH LINE IN.
In this example I have three files in the folder D:\Macro\macro_folder: File 1.mmmacro1 | RUN ACTION | MESSAGE PROMPT | %time%::File 1::1 File 2.mmmacro1 | RUN ACTION | MESSAGE PROMPT | %time%::File 2::1 File 3.mmmacro1 | RUN ACTION | MESSAGE PROMPT | %time%::File 3::1 Each file is a 1 line macro that runs a message prompt with the current time, using the %time% variable. The simple macro below runs each file. At line 1: Here we initialize the FOR file loop, iterating through each file in the D:\macro\macro_folder directory. At line 2: A FOR line loop runs each line in current file iteration. The %FILE% variable holds the current file path variable. At line 3: We close the for loop for the iteration. 1 | FOR | EACH | FILE IN | D:\Macro\macro_folder | DO 2 | FOR | EACH | LINE IN | %FILE% | RUN 3 | FOR | NEXT
|
|
|
Post by Rambo-X on Dec 7, 2020 18:56:06 GMT
Thanks a lot Steve.
This has been the exact answer I have been looking for. Thanks a lot.
|
|