Hi Scott, here's a snippet of code that I use to perform a very similar
function.
Hopefully it will be of use to you.
Does the script work fine when the machine is not locked?
If so, what version of OS do you have it running on?
The only real difference between your approach and mine is how we handle
the print dialog box, and how we return focus to the Meditech
Application.
' The next few lines are pretty similar to what you do.
Downwindow = "Save As"
DOWNFILE = "c:\DEV\NMIAUDIT\NMIAUDIT.IN ~"
AppActivate (Downwindow)
' Our approach varies here.
SendKeys DOWNFILE, True
' I set my focus back to my medic session with the next line.
AppActivate ("HIT")
Pause "End of report"
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Zimmerman, Scott
Sent: Tuesday, September 16, 2003 1:15 PM
To: BostonWorkstation Talk (E-mail)
Subject: [Talk] NPR Downloading while station is locked
Hello,
Part of a recent script I wrote downloads NPR report data in MT Magic.
It is unattended at night and the PC is locked. The script stops when
the when the Windows Save As box is called by the MT "DOWNLOAD"
function. Any ideas why this occurs and how to prevent it?
Public Sub RunDownloadDxs()
Pause "FROM"
Enter "T-1" 'normally would be for T-1
Pause "THRU ENTERED DATE" Enter "T-1" 'normally would be for T-1
Pause "@1,11" Enter "DOWNLOAD"
Pause "Suppress: Nothing, Page banners, Form feeds, or Both?"
Enter ""
Wait 2 Activate ("Save As")
SendKeys ("G:\Enter Lab Dxs\Lab Dxs.txt")
SendKeys ("%S")
Wait 30
Pause "End of report." Enter "" Pause "LAB ABSTRACTING SCRIPT MENU" End
Sub
thanks in advance,
Scott Zimmerman, LIS Analyst
UMass Memorial LIS Department
Phone: 508-334-7237
Pager: 508-426-2178
> "The information transmitted is intended only for the person or entity
> to which it is addressed and may contain confidential and/or
> privileged material. Any review, transmission, re-transmission,
> dissemination or other use of, or taking of any action in reliance
> upon this information by persons or entities other than the intended
> recipient is prohibited. If you received this in error, please contact
> the sender and delete the material from any computer."
>
>