Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Check files in a directory.
#1
Here I am again asking help for a new problem.

I need a macro which checks the presence of some files in a directory.
If the files are present it executes a subsequent macro. If one of the file are not present
he generate an allarm (opening a window allert and running also a sound allarm wav file).

Here and example:

Start "macro1" (in my case is a macro that modify some files)
When "macro1" finish :
Start "macro2" = check file in the directory "Archive"
If all the 4 file are present:
Start "macro3"
If one or more file are not present:
Run a .wav file and open an allert window


Directory name of the 4 file = "Archive"

File to be check = "test.txt"  +  "test1.txt"  +  "test2.txt"  +  "test3.txt"  (NOTE: in the directory should be present other file but the macro must take care only for the presence yes or not of the above files).

CASE 1
If one or more of the 4 files is not present :

1) open an allert window (with .wav audio file as allarm).
2) The .wav file must run for 10 or 15 seconds (settable time)
3) The allert windows it always remains open till I press a button
4) When I press button windows allert  disappeasr and Qmacro shutdown.

CASE 2
If all the 4 file are present:

Run "macro 3"


I read the "wait for" command help but I was not able to find the right solution.

As always you help will be very appreciated.

Thank you !!!
#2
this will do all but instead of playing wav file for 10 to 15 seconds repeats it till ok button on alert window is click.

Macro Macro2
Code:
Copy      Help
str filename filenames=
;$desktop$\Archive\test.txt
;$desktop$\Archive\test1.txt
;$desktop$\Archive\test2.txt
;$desktop$\Archive\test3.txt

foreach filename filenames
,if(!FileExists(filename))
,,Play 5 "C:\Windows\Media\Alarm07.wav" 0
,,mes F"{filename} Not Found!" "File Not Found" "atsx"
,,Play 2 0 -1
,,ret
mac- "Macro3"
#3
Hi Kevin,
This is what I am looking for.

Unvaluable help !

Thanks !!!


Forum Jump:


Users browsing this thread: 1 Guest(s)