genzyme2 Posted April 8, 2009 Report Share Posted April 8, 2009 I have a basic macro that launches a program, activates the window, and then types a series of keystrokes to run the program: <PROGRAM LAUNCH Path="C:\\Program Files\\Agilent\\DNA Analytics 4.0.76\\DNA ANALYTICS 4.0.76.EXE" Mode="\x00" Default_Path="FALSE" Wait="1" Get_Console="FALSE"/> <DELAY Flags="\x01" Time="15"/> <WINDOW ACTIVATE Title="DNA Analytics 4.0 - [ CGH ]" Exact_Match="TRUE" Wildcards="FALSE" _HANDLE="0x0006"/> <ON ERROR/> <CATCH ERROR Code="6"/> <DELAY Flags="\x01" Time="60"/> <WINDOW ACTIVATE Title="DNA Analytics 4.0 - [ CGH ]" Exact_Match="FALSE" Wildcards="FALSE"/> <END CATCH ERROR/> <END ERROR/> <DELAY Flags="\x02" Time="0859"/> <TEXT TYPE Action="0" Text="<CONTROL><TAB>"/> <DELAY Flags="\x02" Time="0859"/> <TEXT TYPE Action="0" Text="<TAB>"/> <DELAY Flags="\x02" Time="0859"/> <TEXT TYPE Action="0" Text="<DOWN ARROW>"/> <DELAY Flags="\x02" Time="0390"/> <TEXT TYPE Action="0" Text="<DOWN ARROW>"/> <DELAY Flags="\x02" Time="0859"/> <TEXT TYPE Action="0" Text="<ENTER>"/> <DELAY Flags="\x02" Time="1234"/> <TEXT TYPE Action="0" Text="<CTRL><TAB>"/> <DELAY Flags="\x02" Time="0859"/> <TEXT TYPE Action="0" Text="<CTRL><TAB>"/> <DELAY Flags="\x02" Time="0859"/> <TEXT TYPE Action="0" Text="<TAB>"/> <DELAY Flags="\x02" Time="0764"/> <TEXT TYPE Action="0" Text="<TAB>"/> <DELAY Flags="\x02" Time="0656"/> <TEXT TYPE Action="0" Text="<TAB>"/> <DELAY Flags="\x02" Time="0733"/> <TEXT TYPE Action="0" Text="<TAB>"/> <DELAY Flags="\x02" Time="0750"/> <TEXT TYPE Action="0" Text="<ENTER>"/> <DELAY Flags="\x02" Time="0750"/> <MACRO STOP/> When the computer is unlocked, the macro performs perfectly. However, when the workstation locks, the macro is misbehaving. According to the Macro log, the macro is executing all the commands however when I unlock the workstation, the program is opened but none of the keystrokes occurred. I have a feeling there is an issue with activating the window when the workstation is locked. For security reasons, I need a solution that does not involve leaving the workstation unlocked. Any help you can provide would be appreciated. Angela Macro Beginner Quote Link to comment Share on other sites More sharing options...
kevin Posted April 8, 2009 Report Share Posted April 8, 2009 When a macro is running, Macro Express sends keystrokes and mouse events to Windows and Windows sends them to the application that has focus. When Windows is locked, if you minimize a remote session or if you disconnect a remote session, Windows stops sending the keystrokes and mouse events to the application. The macro continues to run but Windows discards the keystrokes and mouse events. There is a work-around. If you can use Window Controls to send text and mouse clicks, the macro will continue to run when the workstation is locked. Quote Link to comment Share on other sites More sharing options...
genzyme2 Posted April 8, 2009 Author Report Share Posted April 8, 2009 When a macro is running, Macro Express sends keystrokes and mouse events to Windows and Windows sends them to the application that has focus. When Windows is locked, if you minimize a remote session or if you disconnect a remote session, Windows stops sending the keystrokes and mouse events to the application. The macro continues to run but Windows discards the keystrokes and mouse events. There is a work-around. If you can use Window Controls to send text and mouse clicks, the macro will continue to run when the workstation is locked. How do I use Window Controls to do this? Quote Link to comment Share on other sites More sharing options...
kevin Posted April 8, 2009 Report Share Posted April 8, 2009 How do I use Window Controls to do this? Start by reading the help. Click Help, Macro Express help. Search for the topic 'Controls'. There are several separate pages. Then look at the 'Calc ulator and Note pad' macro found in samples.mex. The samples.mex macro file is installed in the same folder as the Macro Express program files. By default this would be 'c:\Program Files\Macro Express Pro'. You may also download samples.mex from the Sample Macros web page. Quote Link to comment Share on other sites More sharing options...
stevecasper Posted April 8, 2009 Report Share Posted April 8, 2009 How do I use Window Controls to do this? Keep in mind that Windows Controls are not present in every application, web-page, etc. I use them whenever I can, but that's only a very small fraction of how often I wish I could use them. And as far as I know, the only way to know if an application uses them is through trial and error. If there is a better way, I'd love to know about it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.