Jump to content
Macro Express Forums

Clipboard paste works only sporadically


Recommended Posts

I ran the following simple macro written in ME 3 60 times. It always behaved as expected:

Window Activate: Untitled - Notepad

Text Type: Text1 //Paste "Text1" using the clipboard

Text Type: Text2 //Enter "Text2" by simulating keystrokes

 

I ran the same macro written in ME Pro 60 times. 44 of the times it worked correctly; 16 of the times it wrote "Text2" but not "Text1"

 

There seem to be problems of stability of ME Pro vs. ME 3. See also my earlier post, "Macro responds sporadically or not at all to window gaining focus." Are others experiencing this problem?

Link to comment
Share on other sites

My guess is that it is not a problem with the clipboard command. Macros generally run faster in Macro Express Pro. Most likely what is happening is that the paste is taking place before the window has focus.

 

If you insert a Wait for Window command after the the Window Activate command, you should see it work correctly each time.

Link to comment
Share on other sites

My guess is that it is not a problem with the clipboard command. Macros generally run faster in Macro Express Pro. Most likely what is happening is that the paste is taking place before the window has focus.

 

If you insert a Wait for Window command after the the Window Activate command, you should see it work correctly each time.

 

I should have mentioned that I had a wait 500 msec command after the Window Activate command in the test macro, and in any case I was calling the macro when the window already had the focus. So I don't think it's a question of timing. I tried another series of runs later on, and the problem wasn't as bad - two bad pastes out of 50 times - but it's still there.

Link to comment
Share on other sites

You were the guy who wrote about the weird problem of the window focus activations not working, right? Sounds like you have some ad-ware or something running on your system because to me these problems sound related.

 

I do a lot of things like this, mostly in web pages and one thing I noticed is that MEP does run faster and in some cases requires me to slow things down. Essentially they always needed to operate slower so in effect ME3 was automatically adding delays for me:)

Link to comment
Share on other sites

I ran the following simple macro written in ME 3 60 times. It always behaved as expected:

Window Activate: Untitled - Notepad

Text Type: Text1 //Paste "Text1" using the clipboard

Text Type: Text2 //Enter "Text2" by simulating keystrokes

 

I ran the same macro written in ME Pro 60 times. 44 of the times it worked correctly; 16 of the times it wrote "Text2" but not "Text1"

 

There seem to be problems of stability of ME Pro vs. ME 3. See also my earlier post, "Macro responds sporadically or not at all to window gaining focus." Are others experiencing this problem?

I built the following macro to test whether or not I had similar problems to those you describe.

Repeat Start (Repeat 60 times)
 Window Activate: untitled - notepad
 Delay: .5 seconds
 Text Type (Use Clipboard and Paste Text): Text1
 Text Type (Simulate Keystrokes): Text2

 Window Minimize (Simulate Keystrokes): Text2
: Untitled - Notepad
End Repeat

<REPEAT START Start="1" Step="1" Count="60" Save="FALSE"/>
<WINDOW ACTIVATE Title="untitled - notepad" Exact_Match="FALSE" Wildcards="FALSE" _IGNORE="0x0006"/>
<DELAY Flags="\x01" Time=".5"/>
<TEXT TYPE Action="1" Text="Text1"/>
<TEXT TYPE Action="0" Text="Text2\r\n"/>
<WINDOW MINIMIZE Option="\x01" Title="Untitled - Notepad" Partial="TRUE" Wildcards="FALSE" _IGNORE="0x0006"/>
<END REPEAT/>

My experience was a very smooth run. After running it as built above, I removed the .5 second delay and

still had no problems with the macro.

 

I'm running a pretty fast system: Vista Ultimate 32, SP 1, Intel Quad core 2.6 GHz, 4G RAM, so that may

be why I can do it without the delay, but even on a slower system the macro should have no problems

with a built-in delay.

 

I don't personally understand why the same macro would work on ME 3.x but not on ME Pro, but I don't

think it is a problem inherent in ME Pro.

Link to comment
Share on other sites

Thanks for checking the problem and for the suggestions. I un- and reinstalled ME Pro which seems to have cured the activate on window gaining focus problem as well as some others I was having (hopefully for good). However this current problem still persists. I've removed the window activate command from the macro, so all it does is paste or type text into an already-activated window such as Notepad or Wordpad. Thus there are no issues of window activation times. Most of the time it works but perhaps 5% of the time it does not do the clipboard paste even though it does the simulate keystrokes enter. I've noticed that whenever this error occurs the macro beeps. I assume this must be an error catch routine built into ME4, but have no clues beyond that.

Link to comment
Share on other sites

Thanks for checking the problem and for the suggestions. I un- and reinstalled ME Pro which seems to have cured the activate on window gaining focus problem as well as some others I was having (hopefully for good). However this current problem still persists. I've removed the window activate command from the macro, so all it does is paste or type text into an already-activated window such as Notepad or Wordpad. Thus there are no issues of window activation times. Most of the time it works but perhaps 5% of the time it does not do the clipboard paste even though it does the simulate keystrokes enter. I've noticed that whenever this error occurs the macro beeps. I assume this must be an error catch routine built into ME4, but have no clues beyond that.

 

This type of behaviour can sometimes be due to a timing issue. For a start, check the settings under Options > Preferences > Playback. In particular I've found that first one, Delay after keystrokes in the Text Type command, rather critical. The default (not mentioned in Help but appears after clicking 'Reset page') seems to be zero. (I vaguely recall it was 300 µs in ME 3.) I currently have mine set to 2000 µs (i.e. 2 ms), with the others left at 250 ms. Try that and see if it helps.

 

Also, sometimes adding a short delay (say 100 ms) at the start of a macro can cure this sort of thing.

 

--

Terry, East Grinstead, UK

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...