A simple way to do this is to set a variable as follows
strFilename = Dir("full path & filename.ext" ) that you are looking for
The value of strFilename after executing the above statement would be the
complete filename and it would not include the directory, so you would need
to include the directory in future usage of the variable. If the file is not
found it will be empty.
Now how this fits into your Steps/Rules:
Your first rule would execute this statement then goto the next step to
evaluate the variable as follows:
strFileName= wait a few seconds goto lookagain
strfilename <> goto rest of script
Then your datastation open statement would be as follows:
D.Open "c:\mypath\" & strFileName
Keep in mind you will want to consider a configuration .bds if the file name
is going to change.
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Lawrence, Mitchell
Sent: Thursday, August 30, 2007 12:10 PM
To: [email protected]
Subject: [Talk] Method to watch a directory for a specific file
Importance: High
Is there a rules-based (or nice polished vba function) method for watching a
specific directory for a specific file?
I would like to incorporate printing to PDF from Meditech into our scripting
capabilities. I can do this by creating a pdf printer driver (we have full
adobe) that always prints to a specified directory, specified file. During
the creation of a PDF, adobe uses a .tmp file, once the creation of the
document is finished, adobe renames the .tmp file to the actual PDF.
If I was able to "watch" the output directory for the file, I could then
pick that file up and move it to the proper destination/proper name, and
then close out the script.
So I would also need some way to turn off the timeout in BWS, as each file
may take some time to create and would be variable.
Anyone have any ideas for these two things?
* Watching a directory for a specified file (likely a vba
function/subroutine)
* Turning off the timeout in BWS?
Thank you,
Mitch Lawrence
Lead Applications Analyst
Technical Support - NPR/Automation
CHRISTUS Information Management
T: [EMAIL PROTECTED]
Send a <http://intranet.christushealth.org/spiritBuck/> "thank you" to
someone!
<<image001.jpg>>
