Jump to content
Macro Express Forums

dougb1

Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by dougb1

  1. I have a simple macro that does the following: Activate Window "X" Get Control %C8% ("X") Set Focus to %C8% Text Type "some text<ENTER>" The Set Focus fails with the message: "The specified control, C8, could not be found". I used the Capture Window Control utility to get the control name/location. Why then can't the control be found? Thanks, Doug
  2. Well, nothing seems to be helping that much - it's better but still fails. I removed the wait for window command and did 3 Active Window commands back to back. I don't see what breaking up a single macro into 2 will accomplish. The single macro fails on the window title appearing so why would I break it up into 2 macros? I assume you mean that the first would run up to issuing the commands that should make the 2nd window appear and the 2nd macro would then activate when the window appeared. I can prove the window is an active window but the activate window/wait for window command doesn't appear to see it for some reason. Since I've recorded the list of available windows in my debug log *before* the activate/wait for window, I know for a fact the window does exist. This still sounds like a bug to me. Doug
  3. Hi Alan, Thanks for reply and the reassurance I'm approaching this the correct way. I had a 75 MS timedelay after the Wait For Window Title but have just increased it to 250MS - we'll see how that works. I have one example this morning where, after sending the keystrokes to Program B to activate the Input window that the this window title does appear in the visible window list (I write visible windows to my debug file) yet ME aborted stating the window didn't appear within the 8 second max wait. Since the code to list the windows saw it immediately before the Wait for Window Title statement, why didn't Wait For Window Title see it? This sounds like a bug to me. As to the controls my code example below attempted to use the control but as described, it fails on the Set Focus command. Any clues as to why this may be or am I missing something in my code? Thanks, Doug
  4. Hi All, Scenario. Program A puts a bit of data onto the clipboard and displays a window. When the user sees the window created by Program A, they press F9 to activate the MacroExpress macro. ME macro gets data off clipboard and parses out what it needs. It then uses Activate Window followed by Wait For Window Title to ensure that Application B has focus. It then sends some keystrokes via Text Type to activate a search dialog from the menus in Application B which has a title of "Input". The macro then uses Activate Window "Input" and Wait for Window Title "Input" before sending keystrokes to the window to perform the search from the clipboard data. Problem: On occasion, the Input window isn't detected. This tells me that either the keystrokes to Program B didn't get there to activate the window or because of a timing issue, not all the keystrokes made it to Program B. I added debugging to a log file as well as added LogErrors at the top of the macro. The macro is aborting stating 'The window "Input" did not appear within the specified time.'. I have a message written to the debug log file immediately after I do the Wait For Window Title of Program B so I'm pretty confident that Program B had/has focus immediately before sending the text to bring up the search dialog "Input". Questions: 1. Is Wait for Window Title the best way to know that a particular window has focus and is ready to accept keystrokes? We had only Activate Window before and I added Wait for Window Title to ensure the app was available to accept keystrokes. I've got the max wait time set to 8 seconds (up from 5) with no change. We used to have the default of 10 minutes and still experienced the problem so I don't think it's the wait length. 2. I tried using GetControl as follows to avoid sending keystrokes to activate the Input window. The control is a general search box always on the screen that does the same thing as the Input box I have to send keystrokes to in order to display: Activate Window: "FACS Workstation (BDEBT)" Get Control %C8% (FACS Workstation (BDEBT): WindowsForms10.EDIT.app3) Set Focus to %C8% Text Type: Text<ENTER> This fails on the Set Focus line stating "The specified control could not be found". I used the Get control utility to detect the control. This would be the preferred way to send the information to Program B. Am I missing something in order to send keystrokes to the control? Regarding #1, I've added in a hard Wait of 75MS before sending the keystrokes and slowed down the keystrokes to 50 MS but the problem is still happening (perhaps a little better but not foolproof). I've also added new code to write all the visible windows to the debug file - I'm curious if Input really does exist or not. I would expect to NOT see Input in the list of window titles. Thanks, Doug
×
×
  • Create New...