Jump to content
Macro Express Forums

Text Type - Clipboard to Paste


Recommended Posts

I know I brought this up over a year ago, but can't seem to find the original thread.

 

I use ME for multiple clipboards.

 

Example:

COPY

<CLIPBOARD EMPTY/>
<CLIPBOARD COPY/>
<REPEAT UNTIL Variable="%cb%" Condition="\x01"/>
<VARIABLE SET STRING Option="\x02" Destination="%cb%"/>
<DELAY Flags="\x11" Time="0.5"/>
<END REPEAT/>
<WRITE REGISTRY VALUE Key="HKEY_CURRENT_USER\\MEPVariables\\Clipboard002" Destination="%cb%"/>

 

PASTE

 

<READ REGISTRY VALUE Key="HKEY_CURRENT_USER\\MEPVariables\\Clipboard002" Destination="%cb%"/>
<TEXT TYPE Action="1" Text="%cb%"/>

 

The COPY functions perfectly every time. So I'm not worried about that. The PASTE, however, constantly pisses me off.

 

I run macros that pull information from various files across the network, and stores that information locally so that users can utilize the multiple clipboard function to paste it in wherever necessary.

 

Quick example:

Clipboard 1 contains: NAME

Clipboard 2 contains: Street Address

Clipboard 3 contains: City

Clipboard 4 contains: State

Clipboard 5 contains: ZIP

 

It would be nice if exercising the paste function would work right. If I change the settings to keystrokes (rather than paste) it works perfectly. And for short things like names and states, it isn't a big difference - however, there are occasions where the amount of data being pasted is a bit larger (nothing the PC can't handle, and nothing ME can't handle), but typing it - even at ME speeds - takes forever by comparison.

 

I've tried changing the storage from the registry to a simple text file in the temp folder - same exact results.

I've tried adding delays between the read registry command and the text type command - no improvement.

 

Here is the test I performed, in case anybody wants to try to duplicate my results.

 

Use the following code:

COPY

<CLIPBOARD EMPTY/>
<CLIPBOARD COPY/>
<REPEAT UNTIL Variable="%cb%" Condition="\x01"/>
<VARIABLE SET STRING Option="\x02" Destination="%cb%"/>
<DELAY Flags="\x11" Time="0.5"/>
<END REPEAT/>
<VARIABLE MODIFY STRING Option="\x11" Destination="%cb%" Filename="C:\\Temp\\Clipboards\\0001" CRLF="FALSE"/>

 

PASTE

<VARIABLE SET STRING Option="\x03" Destination="%cb%" Filename="C:\\Temp\\Clipboards\\0001" Strip="FALSE"/>
<REPEAT START Start="1" Step="1" Count="100" Save="FALSE"/>
<TEXT TYPE Action="1" Text="%cb%\r\n"/>
<END REPEAT/>

 

This should paste the copied text 100 times. My results varied from once to 23 times.

 

I can't be the only person experiencing this.

 

FWIW: Windows Vista Ultimate 32 - Intel Core 2 Quad @ 2.66GHz - 4GB RAM

Link to comment
Share on other sites

The 'fault' is most likely due to timing. When Macro Express interacts with the Windows clipboard and with other applications they, not Macro Express, determine how fast things happen. Macro Express could be changed to always wait long enough for all clipboard functions to be successful but then every clipboard command would take a full second.

 

Check the 'Wait [ ] milliseconds between clipboard commands' setting found in Options, Preferences, Playback on the Delays tab. This allows you to adjust the amount of time that Macro Express waits between clipboard commands for your specific computer. In our testing we determined that a good compromise value for this was 250 milliseconds. This allowed macros to work 98% or more of the time.

 

Try adjusting the value to a larger value.

 

Another possible issue could be that the application is not able to accept the information as quickly as Macro Express is sending it. If, for example, the pasting of data causes the application to scroll, you will need an additional delay. You could try adding a delay after the Clipboard Paste command.

Link to comment
Share on other sites

Another possible issue could be that the application is not able to accept the information as quickly as Macro Express is sending it.

I have experianced this problem and did a bit of testing and this is what I found. For me it was always the destination application, EG Excel, that was lagging and not 'hearing' the paste becasue it was too busy doing clever things with the last thing I pasted. If I changed to somehtig simple like Notepad it would work flawlessly.

Link to comment
Share on other sites

...

Check the 'Wait [ ] milliseconds between clipboard commands' setting found in Options, Preferences, Playback on the Delays tab. This allows you to adjust the amount of time that Macro Express waits between clipboard commands for your specific computer. In our testing we determined that a good compromise value for this was 250 milliseconds. This allowed macros to work 98% or more of the time.

 

Try adjusting the value to a larger value.

 

Thanks Kevin.

 

I checked this, and it was set at 300. I adjusted it by multiples of 10 as high as 30,000, with no improvement - in fact I didn't notice any change whatsoever in any of the clipboard-related macros I tried - and before you ask: Yes, I made sure that I saved my changes :) )

 

I did however discover something: Apparently I had only tried my "Clipboard 1" macro. I don't seem to be experiencing any problems with clipboards 2-10. I cannot imagine why this is, however, as I have changed the activation for clipboard 1 - originally set to Alt+1, but changed to Alt+Q - without any improvement.

 

Also, the macro actually runs - as demonstrated with the repeat test-version. So the activation itself isn't likely the cause.

 

The application I'm pasting into for the tests is a simple notepad.exe, though I experience it when pasting into anything (Excel, fields in browsers, text boxes like the one I'm typing in right now, etc).

 

It's the most bizarre bug - and I really don't think it's MEP. I'm going to test it in ME3. Will report back.

Link to comment
Share on other sites

I did however discover something: Apparently I had only tried my "Clipboard 1" macro. I don't seem to be experiencing any problems with clipboards 2-10. I cannot imagine why this is, however, as I have changed the activation for clipboard 1 - originally set to Alt+1, but changed to Alt+Q - without any improvement.

 

I take it back. Results are similar - if not identical - on other clipboards. I adjusted the paste macro, adding a counter to the repeat and adjusting the pasted text.

 

<REPEAT START Start="1" Step="1" Count="100" Save="TRUE" Variable="%N[1]%"/>
<READ REGISTRY VALUE Key="HKEY_CURRENT_USER\\MEPVariables\\Clipboard002" Destination="%cb%"/>
<TEXT TYPE Action="1" Text="%N[1]% - %cb%\r\n"/>
<END REPEAT/>

 

Clipboard 1:

2 - Clipboard 1

10 - Clipboard 1

15 - Clipboard 1

18 - Clipboard 1

31 - Clipboard 1

35 - Clipboard 1

36 - Clipboard 1

42 - Clipboard 1

46 - Clipboard 1

52 - Clipboard 1

58 - Clipboard 1

68 - Clipboard 1

73 - Clipboard 1

84 - Clipboard 1

93 - Clipboard 1

95 - Clipboard 1

100 - Clipboard 1

 

Clipboard 2:

 

5 - Clipboard 2

7 - Clipboard 2

18 - Clipboard 2

26 - Clipboard 2

43 - Clipboard 2

45 - Clipboard 2

49 - Clipboard 2

56 - Clipboard 2

62 - Clipboard 2

68 - Clipboard 2

77 - Clipboard 2

79 - Clipboard 2

82 - Clipboard 2

84 - Clipboard 2

91 - Clipboard 2

Link to comment
Share on other sites

I have experianced this problem and did a bit of testing and this is what I found. For me it was always the destination application, EG Excel, that was lagging and not 'hearing' the paste becasue it was too busy doing clever things with the last thing I pasted. If I changed to somehtig simple like Notepad it would work flawlessly.

Thanks for the input, Cory. I had thought about that, but the destination application doesn't appear to be the issue in this case. I experience it in Notepad, Excel, IE, Chrome, etc.

 

btw I got your email, when I get a sec I'll take a closer look at the vbscript. Thanks!

Link to comment
Share on other sites

Thanks Kevin.

 

I checked this, and it was set at 300. I adjusted it by multiples of 10 as high as 30,000, with no improvement - in fact I didn't notice any change whatsoever in any of the clipboard-related macros I tried - and before you ask: Yes, I made sure that I saved my changes :) )

 

I was wrong: I was looking at something else that is set at 300. The paste was set at 20. I've now adjusted this, increased it to 300.

 

This definitely slowed the macro down considerably.

 

And yet, I still ended up with:

5 - Clipboard 1

12 - Clipboard 1

21 - Clipboard 1

37 - Clipboard 1

59 - Clipboard 1

63 - Clipboard 1

85 - Clipboard 1

95 - Clipboard 1

 

I love my computer... why can't it play nice?

Link to comment
Share on other sites

Okay, I have found a consistently successful work-around for my problem. And I've got to be honest, I don't know how this could possibly make a difference (if it is my computer and not MEP), but it does.

 

<READ REGISTRY VALUE Key="HKEY_CURRENT_USER\\MEPVariables\\Clipboard001" Destination="%cb%"/>
<VARIABLE MODIFY STRING Option="\x10" Destination="%cb%"/>
<CLIPBOARD PASTE/>

 

I honestly believe my computer must be contributing to the problem, but I can't help but think there is something wrong with the Text Type > Use Clipboard to Paste function, since the Clipboard Paste command works just fine.

 

Anyway, the work-around is simple, if not quite as elegant as I would like, and for now it seems I only really have to worry about it on my own PC.

 

Thanks to everybody for looking at the issue and giving me pointers.

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