Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello!
I've made an app to check if a file exists in a folder and whether it was created before 615 am.
I'm using vfileexists as a counter. I have a Nprinting app through which I'm trying to shoot a mail if the condition is not satisfied. Any help is appreciated! Thanks!
Code:
//To retrieve filename and load it in field filename
for each File in FileList('\\gmo\bosprod\CollineData\PACE\HOLDINGS\Working\*.csv')
File:
LOAD *, FileBaseName() as FileName
FROM [$(File)]
(txt, codepage is 1252, embedded labels, delimiter is spaces) ;
NEXT File
//To check if file was created before 6.16 am
let vFileExists = 0;
For each File in ('\\gmo\bosprod\CollineData\PACE\HOLDINGS\Working\*.csv')
when MakeTime(QvdCreateTime(FileName)<='(06,15)'
let vFileExists = 1;
exit for when $(vFileExists) = 1;
NEXT File
I have a potentially better solution for you:
Scroll down to the File Exists section and have a look. I do not think the triggers or dependencies are going to have any impact though, was thinking might be a way to tie things together with that, but maybe this can be the main trigger to things anyway, figured it was worth a shot.
The other option would be to simply create a PowerShell script instead of trying to run this as a macro in an app and use Publisher Support Task to run the PS script at the designated time... That may actually be the better option now that I think about it. You could have that task trigger whatever based upon the results of the PS script then...
Regards,
Brett