Jump to content
Macro Express Forums

Macro doesn't work in proprietary application


ward

Recommended Posts

I'm trying to use a macro on an application called InfoWeb Knowledge Center. I can get the app to take focus, but after that it shows no changes; no keystrokes are carried out, and no tabbing from field to field. I've tried both Type Text Normally and Send Text to Control. No joy from the former, and for the latter I keep getting

 

"The specified control, C2, could not be found."

 

The error log says

 

"5/19/2010 8:31:01 AM The macro "Test KC Macro" has been aborted. The specified control, C2, could not be found."

 

Does Macro Express simply not work on certain types of applications?

 

I'm using Windows 7 on a 64-bit machine. Here's the script:

 

<LOGERR:N>

<IFOTH:04:2:InfoWeb>

<ACTIVATE2:InfoWeb>

<ENDIF>

<PAUSE2:000015,000015No message.T>

<TEXTTYPECT:2:d>

<TEXTTYPE:<TAB>>

<GETCONTROL2:01:ÄD

:WindowsForms10.Window.8.app3InfoWeb Knowledge Center / Content / v-wardwe003:6WindowsForms10.SysTabControl32.app312WindowsForms10.Window.8.app320WindowsForms10.EDIT.app3>

<MSTOP>

Link to comment
Share on other sites

There are many forms where controls don't work, or don't work the way you need them to.

 

Straight typing with a macro should work. If you can type by hand, the macro should be able to type. On some forms, you might have to position for typing by clicking the mouse in the first field to be typed, or by clicking somewhere on the form and then tabbing into the first field. Take note of exactly how you do it by hand, then simulate that with the macro.

Link to comment
Share on other sites

There are many forms where controls don't work, or don't work the way you need them to.

 

Straight typing with a macro should work. If you can type by hand, the macro should be able to type. On some forms, you might have to position for typing by clicking the mouse in the first field to be typed, or by clicking somewhere on the form and then tabbing into the first field. Take note of exactly how you do it by hand, then simulate that with the macro.

 

Thanks, rberq, for the suggestion. I tried to use the Mouse Locator to determine a screen or window position to click on, but as soon as I moved the mouse pointer onto the application, the Screen Position and Active Window numbers stopped--as if I'd moved onto a dead zone or something.

 

So I estimated the position required--anywhere in the app would do--and specified a mouse click there plus some tabs. But again nothing happened; the app took focus but no tabbing occurred in its window, and no entry in the Error Log.

 

Looks as if this app is unmacroable. . . :(

Link to comment
Share on other sites

I tried to use the Mouse Locator to determine a screen or window position to click on, but as soon as I moved the mouse pointer onto the application, the Screen Position and Active Window numbers stopped--as if I'd moved onto a dead zone or something.

 

So I estimated the position required--anywhere in the app would do--and specified a mouse click there plus some tabs. But again nothing happened; the app took focus but no tabbing occurred in its window, and no entry in the Error Log.

There are two possible causes.

 

Macro Express sends keystrokes, mouse movements and mouse clicks using the 'Windows Hooks'. This requires cooperation between applications. An application can 'steal' the hooks to prevent another application sending it information. This is sometimes done on purpose in the name of security. One known case of this is the password dialog for Quicken. Macro Express cannot type the password. (This also keeps keylogger malware programs from capturing the password as you type.)

 

Another possible cause is due to how Windows 7 handles the interaction between programs. On Windows 7 if Macro Express is running as a normal program (non-administrator) and another program is running as administrator, then Macro Express cannot send keystrokes or mouse clicks to it.

Link to comment
Share on other sites

Ward,

 

Many times an application will have more than one Control for a given field. In general this is because of some sort of caching of the forms the application is doing. So maybe sometimes a macro works and other times it does. What you can do is multiple "Get Controls" like the following example:

 

<LOGERR:N>
<IFOTH:04:2:InfoWeb>
<ACTIVATE2:InfoWeb>
<ENDIF>
<PAUSE2:000015,000015No message.T>
<TEXTTYPECT:2:d>
<WAITPB>
<TEXTTYPE:<TAB>>
<WAITPB>
<GETCONTROL2:01:ÄD
:WindowsForms10.window.8.app3InfoWeb Knowledge Center / Content / v-wardwe003:6WindowsForms10.SysTabControl32.app312WindowsForms10.window.8.app320WindowsForms10.EDIT.app3>
<IFCONTROL:06:01>
<GETCONTROL2:01:ÄD
:WindowsForms10.window.8.app3InfoWeb Knowledge Center / Content / v-wardwe003:6WindowsForms10.SysTabControl32.app312WindowsForms10.window.8.app320WindowsForms10.EDIT.app3>
<ENDIF>
<IFCONTROL:06:01><GETCONTROL2:01:ÄD
:WindowsForms10.window.8.app3InfoWeb Knowledge Center / Content / v-wardwe003:6WindowsForms10.SysTabControl32.app312WindowsForms10.window.8.app320WindowsForms10.EDIT.app3>
<ENDIF>
<VARGETCONT:1:1>
<TBOX4:T:4:CenterCenter000278000200:000:TESTT1 = %T1%>
<MSTOP>

 

So you "Get Control", then "If Not Control Enabled" you grab the second Control, and so on and so on for as many as you find. To figure out what is changing in the Control, I run the macro over and over until it fails (on my machine as well as others) and then duplicate the If/Get/End If and capture the Control that just failed (which should be different from the previous ones).

Link to comment
Share on other sites

Thanks for the suggestion, PatrickB; I'll try that.

 

Ward,

 

Many times an application will have more than one Control for a given field. In general this is because of some sort of caching of the forms the application is doing. So maybe sometimes a macro works and other times it does. What you can do is multiple "Get Controls" like the following example:

 

<LOGERR:N>
<IFOTH:04:2:InfoWeb>
<ACTIVATE2:InfoWeb>
<ENDIF>
<PAUSE2:000015,000015No message.T>
<TEXTTYPECT:2:d>
<WAITPB>
<TEXTTYPE:<TAB>>
<WAITPB>
<GETCONTROL2:01:ÄD
:WindowsForms10.window.8.app3InfoWeb Knowledge Center / Content / v-wardwe003:6WindowsForms10.SysTabControl32.app312WindowsForms10.window.8.app320WindowsForms10.EDIT.app3>
<IFCONTROL:06:01>
<GETCONTROL2:01:ÄD
:WindowsForms10.window.8.app3InfoWeb Knowledge Center / Content / v-wardwe003:6WindowsForms10.SysTabControl32.app312WindowsForms10.window.8.app320WindowsForms10.EDIT.app3>
<ENDIF>
<IFCONTROL:06:01><GETCONTROL2:01:ÄD
:WindowsForms10.window.8.app3InfoWeb Knowledge Center / Content / v-wardwe003:6WindowsForms10.SysTabControl32.app312WindowsForms10.window.8.app320WindowsForms10.EDIT.app3>
<ENDIF>
<VARGETCONT:1:1>
<TBOX4:T:4:CenterCenter000278000200:000:TESTT1 = %T1%>
<MSTOP>

 

So you "Get Control", then "If Not Control Enabled" you grab the second Control, and so on and so on for as many as you find. To figure out what is changing in the Control, I run the macro over and over until it fails (on my machine as well as others) and then duplicate the If/Get/End If and capture the Control that just failed (which should be different from the previous ones).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...