Jump to content
Macro Express Forums

MEP or Windows?


Recommended Posts

I'm not sure where the problem is on this one, so if anybody could attempt to duplicate my results, I'd love to know what you think.

 

I've built the following two macros as tests. If you could build similar macros (or just use mine) and tell me what your results are, it would really help me to understand better what is wrong:

 

Macro 1: This macro uses the Text Type (Clipboard Paste) command to enter text directly (Note: for both macros, the End Repeat is the end of the test, the rest of the code is merely for ease of counting how many times the Paste worked).

<REPEAT START Start="1" Step="1" Count="50" Save="TRUE" Variable="%Iteration%"/>
<TEXT TYPE Action="1" Text="Test %Iteration%\r\n"/>
<END REPEAT/>
<DELAY Flags="\x01" Time=".1"/>
<TEXT TYPE Action="0" Text="<CONTROL>a"/>
<WAIT FOR TEXT PLAYBACK Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/>
<DELAY Flags="\x01" Time=".1"/>
<CLIPBOARD COPY/>
<DELAY Flags="\x01" Time=".1"/>
<VARIABLE SET STRING Option="\x02" Destination="%Clipboard%"/>
<VARIABLE SET INTEGER Option="\x0D" Destination="%NLength[1]%" Text_Variable="%Clipboard%"/>
<VARIABLE MODIFY STRING Option="\x0F" Destination="%Clipboard%" ToReplace="Test" All="TRUE" IgnoreCase="FALSE"/>
<VARIABLE SET INTEGER Option="\x0D" Destination="%NLength[2]%" Text_Variable="%Clipboard%"/>
<VARIABLE MODIFY INTEGER Option="\x01" Destination="%NLength[3]%" Value1="%NLength[1]%" Value2="%NLength[2]%"/>
<VARIABLE MODIFY INTEGER Option="\x03" Destination="%NLength[4]%" Value1="%NLength[3]%" Value2="4"/>
<TEXT BOX DISPLAY Title="Number of times it appears" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs16 Repeats Executed: %Iteration%\r\n\\par Successful Repeats: %NLength[4]%\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="1" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/>

Macro 2: This macro places the text into a variable, and then uses the Text Type to paste from the variable.

<VARIABLE SET STRING Option="\x00" Destination="%Test%" Value="Test"/>
<REPEAT START Start="1" Step="1" Count="50" Save="TRUE" Variable="%Iteration%"/>
<TEXT TYPE Action="1" Text="%Test% %Iteration%\r\n"/>
<END REPEAT/>
<DELAY Flags="\x01" Time=".1"/>
<TEXT TYPE Action="0" Text="<CONTROL>a"/>
<WAIT FOR TEXT PLAYBACK Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/>
<DELAY Flags="\x01" Time=".1"/>
<CLIPBOARD COPY/>
<DELAY Flags="\x01" Time=".1"/>
<VARIABLE SET STRING Option="\x02" Destination="%Clipboard%"/>
<VARIABLE SET INTEGER Option="\x0D" Destination="%NLength[1]%" Text_Variable="%Clipboard%"/>
<VARIABLE MODIFY STRING Option="\x0F" Destination="%Clipboard%" ToReplace="Test" All="TRUE" IgnoreCase="FALSE"/>
<VARIABLE SET INTEGER Option="\x0D" Destination="%NLength[2]%" Text_Variable="%Clipboard%"/>
<VARIABLE MODIFY INTEGER Option="\x01" Destination="%NLength[3]%" Value1="%NLength[1]%" Value2="%NLength[2]%"/>
<VARIABLE MODIFY INTEGER Option="\x03" Destination="%NLength[4]%" Value1="%NLength[3]%" Value2="4"/>
<TEXT BOX DISPLAY Title="Number of times it appears" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs16 Repeats Executed: %Iteration%\r\n\\par Successful Repeats: %NLength[4]%\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="1" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/>

 

In both cases I experience inconsistent failure rate. It's better than a previously reported %25% failure rate (reported in another thread), but any failure can be devastating to the macro itself.

 

If I change the Use Clipboard to Simulate keystrokes, I have a 0% failure rate (which is fine - considerably faster actually - for short texts like this, but unacceptably slow for longer (full page) pastes.

 

Is this Macro Express, or Windows? Somebody help me make my Paste function work, please!

Link to comment
Share on other sites

Like I told you, your problem is probably with whatever you are using for a clipboard utility. Sounds like the Office Clipboard. See my other post on how to disable it. Or post a pic and we can determine what it is and how to get rid of it.

 

Understand that there is only one Windows clipboard and it has only one slot for stuff. Also understand that MEP does not have a clipboard, it just accesses the Windows Clipboard. If you have something that's trying to access it at the same time wto give you a quasi-multi-clipboard you are bound to have conflicts.

 

Having said all that you can still have issues with the timing of clipboard actions and you can go to fast. Let's face it, if you're coping a huge amount of data it will probably take longer. So if you do not have any other utilities running and suspect a timing issue with the clipboard then add some huge delays and run a test macro. Add 500mS before and after and you should have 100% accuracy. Then start ramping down the delay (make it a variable) until your test macro starts having failures. This will be very telling.

Link to comment
Share on other sites

Like I told you, your problem is probably with whatever you are using for a clipboard utility. Sounds like the Office Clipboard. See my other post on how to disable it. Or post a pic and we can determine what it is and how to get rid of it.

 

Understand that there is only one Windows clipboard and it has only one slot for stuff. Also understand that MEP does not have a clipboard, it just accesses the Windows Clipboard. If you have something that's trying to access it at the same time wto give you a quasi-multi-clipboard you are bound to have conflicts.

 

Having said all that you can still have issues with the timing of clipboard actions and you can go to fast. Let's face it, if you're coping a huge amount of data it will probably take longer. So if you do not have any other utilities running and suspect a timing issue with the clipboard then add some huge delays and run a test macro. Add 500mS before and after and you should have 100% accuracy. Then start ramping down the delay (make it a variable) until your test macro starts having failures. This will be very telling.

Yeah, I know all this. I'm an idiot, but not that idiotic. :)

 

1. The clipboard I'm using is the windows clipboard.

2. When I say "ME clipboards" I'm referring to macros that use the Clipboard Copy/Paste commands (and like ilk).

3. When using the afore mentioned ME clipboards, the Clipboard Copies are always assigned to a variable (with the occasional exception of Text Type commands) in order to avoid conflicts.

 

The timing of the clipboard isn't the issue, either. The macros posted above don't even use any Copy commands within the repeat (which is the important part of the two macros). It's the paste that is failing.

 

I just tested both of the above macros on my home computer and they both worked successfully on multiple runs, which tells me my flippin' work computer is a pile o' poo (which I honestly already knew).

 

So I guess what I really need is to understand how the Windows clipboard works, so I can try to fix it. I don't expect this forum to be the best source of information on the matter, but I trust all the regular posters here, so if anybody does have an idea, that would be great. In the mean-time I'll be scouring the inter-web.

Link to comment
Share on other sites

Steve,

 

1. Have you played with the settings under Options > Preferences > Playback, including 'Use the Hardware High Speed Timer when Possible'?

 

2. Is there any evidence of another program or service conflicting with the pastes? I know from my own experience how hard these can be to track down. One utility that might help is ProcMon

(Process Monitor):

http://download.sysinternals.com/Files/ProcessMonitor.zip

You'll have to invest a little time to get the best use of it. In particular, the mass of data that will be created by it in the couple of seconds your test macro is misbehaving will probably be overwhelming, but careful use of the Filters might isolate a clue. Having said all that, I still have several intermittent performance problems (not ME Pro related) that I haven't sorted! But worth a try if you're desperate.

 

3. Can you post the smallest possible fragment of direct editor code that gives the unreliable result and I'll try it here over a period. If anything should conflict, my stuff should!

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

Steve,

 

1. Have you played with the settings under Options > Preferences > Playback, including 'Use the Hardware High Speed Timer when Possible'?

 

2. Is there any evidence of another program or service conflicting with the pastes? I know from my own experience how hard these can be to track down. One utility that might help is ProcMon

(Process Monitor):

http://download.sysinternals.com/Files/ProcessMonitor.zip

You'll have to invest a little time to get the best use of it. In particular, the mass of data that will be created by it in the couple of seconds your test macro is misbehaving will probably be overwhelming, but careful use of the Filters might isolate a clue. Having said all that, I still have several intermittent performance problems (not ME Pro related) that I haven't sorted! But worth a try if you're desperate.

 

3. Can you post the smallest possible fragment of direct editor code that gives the unreliable result and I'll try it here over a period. If anything should conflict, my stuff should!

 

--

Terry, East Grinstead, UK

1. I have not, but I will as soon as I get to work. Though I no longer suspect ME Pro has anything to do with this bug. It's just the means by which I'm using the paste function.

 

2. There is always the possibility that something else on my machine is evil. It's my work computer, so there very well could be some insidious spyware installed by Big Brother which is fiddling with my processes. I don't know if I'll be able to download and install the ProcMon software, but I'll look into it.

 

3. The smallest possible DE script will look like this:

<TEXT TYPE Action="1" Text="a"/>

 

I added repeats in order to process the maximum number of iterations of this function in the least amount of time. I also added code (in the original examples) that then counted how many times the function was successful; but essentially, this single line of code is where my troubles lie in wait.

 

I'll run it from home right now in this post, and then when I get to work, I'll edit the post running it from there (I'm re-adding the repeats). Not because I doubt anybody believes me, but simply because I get bored and this is a form of sad entertainment.

 

From Home:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - My count: 50

 

From Work:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - My count: 37 (surprisingly, the worst results so far. Usually I get between 45 and 48 successful pastes)

 

If there is something interfering, it is something that runs on start-up. This little test is the first thing I did after booting my system. I have one IE window open, and MEP.

Link to comment
Share on other sites

1. I have not, but I will as soon as I get to work. Though I no longer suspect ME Pro has anything to do with this bug. It's just the means by which I'm using the paste function.

 

2. There is always the possibility that something else on my machine is evil. It's my work computer, so there very well could be some insidious spyware installed by Big Brother which is fiddling with my processes. I don't know if I'll be able to download and install the ProcMon software, but I'll look into it.

 

3. The smallest possible DE script will look like this:

<TEXT TYPE Action="1" Text="a"/>

 

I added repeats in order to process the maximum number of iterations of this function in the least amount of time. I also added code (in the original examples) that then counted how many times the function was successful; but essentially, this single line of code is where my troubles lie in wait.

 

I'll run it from home right now in this post, and then when I get to work, I'll edit the post running it from there (I'm re-adding the repeats). Not because I doubt anybody believes me, but simply because I get bored and this is a form of sad entertainment.

 

From Home:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - My count: 50

 

From Work:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - My count: 37 (surprisingly, the worst results so far. Usually I get between 45 and 48 successful pastes)

 

If there is something interfering, it is something that runs on start-up. This little test is the first thing I did after booting my system. I have one IE window open, and MEP.

 

1. I have not, but I will as soon as I get to work. Though I no longer suspect ME Pro has anything to do with this bug. It's just the means by which I'm using the paste function.

 

2. There is always the possibility that something else on my machine is evil. It's my work computer, so there very well could be some insidious spyware installed by Big Brother which is fiddling with my processes. I don't know if I'll be able to download and install the ProcMon software, but I'll look into it.

 

3. The smallest possible DE script will look like this:

<TEXT TYPE Action="1" Text="a"/>

 

I added repeats in order to process the maximum number of iterations of this function in the least amount of time. I also added code (in the original examples) that then counted how many times the function was successful; but essentially, this single line of code is where my troubles lie in wait.

 

I'll run it from home right now in this post, and then when I get to work, I'll edit the post running it from there (I'm re-adding the repeats). Not because I doubt anybody believes me, but simply because I get bored and this is a form of sad entertainment.

 

From Home:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - My count: 50

 

From Work:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - My count: 37 (surprisingly, the worst results so far. Usually I get between 45 and 48 successful pastes)

 

If there is something interfering, it is something that runs on start-up. This little test is the first thing I did after booting my system. I have one IE window open, and MEP.

 

I reproduced similar results here. It seems dependent on

 

1) Settings in Options > Preferences > Playback

More on that later

 

2) The application into which I was pasting

I only tried two, TextPad (my usual editor) and Notepad (for common access). As you see below, Notepad pasted reliably over a dozen or so tests. TextPad however never gave a correct result.

 

My macro simply used your command (with an 'x' character) repeated 50 times, showing the results for both

Number of 'x's that should have been pasted (50)

and

Number that was pasted = %ActualNumberOfPastes%

 

 

The code was:

 

<REPEAT START Start="1" Step="1" Count="50" Save="TRUE" Variable="Total"/>
<TEXT TYPE Action="1" Text="x"/>
<END REPEAT/>
<TEXT TYPE Action="0" Text="<SHIFT><HOME>"/>
<DELAY Flags="\x02" Time="100"/>
<TEXT TYPE Action="0" Text="<CONTROL>c"/>
<DELAY Flags="\x02" Time="100"/>
<VARIABLE SET STRING Option="\x02" Destination="ActualTextPasted"/>
<VARIABLE SET INTEGER Option="\x0D" Destination="ActualNumberOfPastes" Text_Variable="%ActualTextPasted%"/>
<TEXT TYPE Action="0" Text="<END><ENTER>\r\n"/>
<DELAY Flags="\x02" Time="100"/>
<TEXT TYPE Action="0" Text="Number of 'x's  that should have been pasted = %Total%\r\nNumber that was pasted = %ActualNumberOfPastes%\r\n"/>
<DELAY Flags="\x02" Time="100"/>
<TEXT TYPE Action="0" Text="<ENTER><ENTER>"/>

 

Here are some results

 

THIS IS IN MY TEXT EDITOR, TEXTPAD

 

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

 

Number of 'x's that should have been pasted = 50

Number that was pasted = 48

 

 

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

 

Number of 'x's that should have been pasted = 50

Number that was pasted = 46

 

 

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

 

Number of 'x's that should have been pasted = 50

Number that was pasted = 48

 

 

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

 

Number of 'x's that should have been pasted = 50

Number that was pasted = 44

 

 

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

 

Number of 'x's that should have been pasted = 50

Number that was pasted = 46

 

 

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

 

Number of 'x's that should have been pasted = 50

Number that was pasted = 46

 

 

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

 

Number of 'x's that should have been pasted = 50

Number that was pasted = 47

 

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

 

Number of 'x's that should have been pasted = 50

Number that was pasted = 44

 

etc, etc

 

NOW SWITCHED TO RUNNING THE MACRO IN NOTEPAD

 

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

 

Number of 'x's that should have been pasted = 50

Number that was pasted = 50

 

 

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

 

Number of 'x's that should have been pasted = 50

Number that was pasted = 50

 

 

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

 

Number of 'x's that should have been pasted = 50

Number that was pasted = 50

 

 

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

 

Number of 'x's that should have been pasted = 50

Number that was pasted = 50

 

 

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

 

Number of 'x's that should have been pasted = 50

Number that was pasted = 50

 

 

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

 

Number of 'x's that should have been pasted = 50

Number that was pasted = 50

 

etc, etc

 

Coming back to the settings. This is what mine were for the tests above:

 

Options > Preferences > Playback

Delays

Delay after keystrokes in the Text Type command: 1000 microseconds

Use the hardware high-speed timer when possible: Enabled

Wait 1 milliseconds between failed clipboard commands

Wait 250 milliseconds after executing the Window Activate command

 

Note that I had changed my default of 250 ms for 'milliseconds between failed clipboard commands' to 1 ms (1000 microseconds). But this raises a side-issue I'm puzzling over. With that at 250 ms, that's how long every x was taking to get pasted. Does that mean that every paste 'failed' and had to be repeated? I had assumed this would be a relatively rare event, and that the wait (250 ms by default) would only occur then. But my 50 'x's were taking about 4 seconds to type. (Of course, the same time was taken using strings of much greater length than 1.)

 

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

Terry,

 

I just tried your macro (run in notepad) and this was my result (had to use [ code ] to save the spaces:

 

x  x  x  x  x  x  x  x  x	x  x  x  x  x  x  x  x  x	x  x  x  x  x  x  x  x  x  x  x  x  x  x  x	x  x  x  x  x  x  x  x  x  x  x  x	   

 Number of \'x\'s  that should have been pasted = 50
Number that was pasted = 1

 

Notice that more than one x was pasted, despite the results. You have an awful lot of blank Text Types (I understand them within the Repeat -

it\'s the ones outside whose inclusion isn\'t immediately obvious to me.

 

But I like your build that shows exactly where the missing x\'s are.

 

My settings are at the 300 and 250 defaults. I changed the 300 to 1000 to match yours and had similar results.

Link to comment
Share on other sites

Terry,

 

I just tried your macro (run in notepad) and this was my result (had to use [ code ] to save the spaces:

 

x  x  x  x  x  x  x  x  x	x  x  x  x  x  x  x  x  x	x  x  x  x  x  x  x  x  x  x  x  x  x  x  x	x  x  x  x  x  x  x  x  x  x  x  x	   

	Number of \'x\'s  that should have been pasted = 50
  Number that was pasted = 1

 

Notice that more than one x was pasted, despite the results. You have an awful lot of blank Text Types (I understand them within the Repeat -

it\'s the ones outside whose inclusion isn\'t immediately obvious to me.

 

But I like your build that shows exactly where the missing x\'s are.

 

My settings are at the 300 and 250 defaults. I changed the 300 to 1000 to match yours and had similar results.

 

I don't understand your result. Did you just run my exact macro in Notepad? As you see from the following Script Editor code, after pasting it simply copies the entire paste to the clipboard, gets its length, and types result information on the next two lines.

 

Are you saying that on the first line in Notepad you got x then space... 9 pairs like that, followed by two spaces, followed by another identical 9 pairs as before, followed by two spaces, followed by 15 pairs, followed by two spaces, followed by 12 pairs? That's a total of 139 characters pasted by 50 paste commands?

 

Also, I don't follow what you mean by "blank Text Types"?

 

BTW, note that the default settings are not "300 and 250". They are:

 

Delay after keystrokes in the Text Type command = 0 microseconds

Wait 250 milliseconds between failed clipboard commands

Wait 250 milliseconds after executing the Window Activate command

 

What about that hardware option I mentioned earlier?

 

 

Repeat Start (Repeat 50 times)

Text Type (Use Clipboard and Paste Text): x

End Repeat

Text Type (Simulate Keystrokes): <SHIFT><HOME>

Delay: 100 milliseconds

Text Type (Simulate Keystrokes): <CONTROL>c

Delay: 100 milliseconds

Variable Set String ActualTextPasted from the clipboard contents

Variable Set Integer ActualNumberOfPastes to the length of variable %ActualTextPasted%

Text Type (Simulate Keystrokes): <END><ENTER>

 

Delay: 100 milliseconds

Text Type (Simulate Keystrokes): Number of 'x's that should have been pasted = %Total%

Number that was pasted = %ActualNumberOfPastes%

 

Delay: 100 milliseconds

Text Type (Simulate Keystrokes): <ENTER><ENTER>

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

I don't understand your result. Did you just run my exact macro in Notepad? As you see from the following Script Editor code, after pasting it simply copies the entire paste to the clipboard, gets its length, and types result information on the next two lines.

 

Are you saying that on the first line in Notepad you got x then space... 9 pairs like that, followed by two spaces, followed by another identical 9 pairs as before, followed by two spaces, followed by 15 pairs, followed by two spaces, followed by 12 pairs? That's a total of 139 characters pasted by 50 paste commands?

 

Also, I don't follow what you mean by "blank Text Types"?

 

BTW, note that the default settings are not "300 and 250". They are:

 

Delay after keystrokes in the Text Type command = 0 microseconds

Wait 250 milliseconds between failed clipboard commands

Wait 250 milliseconds after executing the Window Activate command

 

What about that hardware option I mentioned earlier?

 

 

Repeat Start (Repeat 50 times)

Text Type (Use Clipboard and Paste Text): x

End Repeat

Text Type (Simulate Keystrokes): <SHIFT><HOME>

Delay: 100 milliseconds

Text Type (Simulate Keystrokes): <CONTROL>c

Delay: 100 milliseconds

Variable Set String ActualTextPasted from the clipboard contents

Variable Set Integer ActualNumberOfPastes to the length of variable %ActualTextPasted%

Text Type (Simulate Keystrokes): <END><ENTER>

 

Delay: 100 milliseconds

Text Type (Simulate Keystrokes): Number of 'x's that should have been pasted = %Total%

Number that was pasted = %ActualNumberOfPastes%

 

Delay: 100 milliseconds

Text Type (Simulate Keystrokes): <ENTER><ENTER>

--

Terry, East Grinstead, UK

Oh geez... I've got issues. I copied what was in your code (didn't bother reading it, expecting the copy/paste to work), and what I got is this:

Repeat Start (Repeat 50 times)
 Text Type (Simulate Keystrokes):  
 Text Type (Use Clipboard and Paste Text): x
 Text Type (Simulate Keystrokes):  
End Repeat
Text Type (Simulate Keystrokes):  
Text Type (Simulate Keystrokes): <SHIFT><HOME>
Text Type (Simulate Keystrokes):  
Delay: 100 milliseconds
Text Type (Simulate Keystrokes):  
Text Type (Simulate Keystrokes): <CONTROL>c
Text Type (Simulate Keystrokes):  
Delay: 100 milliseconds
Text Type (Simulate Keystrokes):  
Variable Set String ActualTextPasted from the clipboard contents
Text Type (Simulate Keystrokes):  
Variable Set Integer ActualNumberOfPastes to the length of variable %ActualTextPasted%
Text Type (Simulate Keystrokes):  
Text Type (Simulate Keystrokes): <END><ENTER>

Text Type (Simulate Keystrokes):  
Delay: 100 milliseconds
Text Type (Simulate Keystrokes):  
Text Type (Simulate Keystrokes): Number of 'x's  that should have been pasted = %Total%
Number that was pasted = %ActualNumberOfPastes%

Text Type (Simulate Keystrokes):  
Delay: 100 milliseconds
Text Type (Simulate Keystrokes):  
Text Type (Simulate Keystrokes): <ENTER><ENTER>

 

Now that I've looked at your actual code I see that the extra Text Types are being added in by my copy/paste... I've got no idea what is going on here.

 

So the extra spaces (which I had thought you added to make it easier to see where the 'x' was being missed) was actually a glitch in how the commands copied into my macro. This is becoming a joke. Not a very funny one, though.

 

The defaults on my machine are:

 

Delay after keystorkes in Text Type command: 300 microseconds

Wait between failed clipboard commands and Window Activate command are both 250

 

The "Use the hardware high-speed timer when possible" option is checked by default. If you were referring to a different hardware option, please remind me. I have not attempted to download the ProcMon program just yet (I hesitate to download anything onto my work computer).

 

I rarely change my defaults... I may have changed the Text Type delay to 300 microseconds, but I don't recall doing so.

Link to comment
Share on other sites

I've emailed ISS Support about this, asking for clarification on exactly whether '...failed clipboard commands' really means '...all clipboard commands' as it appears from my experiments above.

I also sent them the macro. Here it is again, with a few comments added since the original. Hopefully you've got your system sorted at least to the extent of being able to get this code into the Direct Editor now! :rolleyes:

 

Script

 

Repeat Start (Repeat 50 times)

// This macro assumes you have a text application, Notepad or whatever, open ready to accept typing.

 

It should type 50 'x' characters, or whatever single characters you have on the Windows Clipboard, using Clipboard Paste. Then on the next line it counts these and displays the result.

 

It should always be 50, but both Scasper and I have found that it varies widely. See thread

http://pgmacros.invisionzone.com/index.php?showtopic=3907

// In my case the relaibility of Clipboard Paste seems to depend on two factors:

 

1. The setting Options > Preferences > Playback > 'milliseconds between failed clipboard commands'

With the default of 250 ms results seem reliable. But if this delay occurs EVERY time a Clipboard Paste is executed, as appears to be the case (not juts when it 'fails', whatever that means) then it can make macros glacially slow.

 

2. The application

I only tried two. With low values of the above setting I got poor results with my normal text editor, TextPad, yet pasting into Notepad still proved reliable.

Text Type (Use Clipboard and Paste Text): x

End Repeat

Text Type (Simulate Keystrokes): <SHIFT><HOME>

Delay: 100 milliseconds

Text Type (Simulate Keystrokes): <CONTROL>c

Delay: 100 milliseconds

Variable Set String ActualTextPasted from the clipboard contents

Variable Set Integer ActualNumberOfPastes to the length of variable %ActualTextPasted%

Text Type (Simulate Keystrokes): <END><ENTER>

 

Delay: 100 milliseconds

Text Type (Simulate Keystrokes): Number of 'x's that should have been pasted = %Total%

Number that was pasted = %ActualNumberOfPastes%

 

Delay: 100 milliseconds

Text Type (Simulate Keystrokes): <ENTER><ENTER>

 

<REPEAT START Start="1" Step="1" Count="50" Save="TRUE" Variable="Total"/>
<COMMENT Value="This macro assumes you have a text application, Notepad or whatever, open ready to accept typing.\r\n\r\nIt should type 50 'x' characters, or whatever single characters you have on the Windows Clipboard, using Clipboard Paste. Then on the next line it counts these and displays the result.\r\n\r\nIt should always be 50, but both Scasper and I have found that it varies widely. See thread\r\nhttp://pgmacros.invisionzone.com/index.php?showtopic=3907"/>
<COMMENT Value="In my case the relaibility of Clipboard Paste seems to depend on two factors:\r\n\r\n1. The setting Options > Preferences > Playback > 'milliseconds between failed clipboard commands'\r\nWith the default of 250 ms results seem reliable. But if this delay occurs EVERY time a Clipboard Paste is executed, as appears to be the case (not juts when it 'fails', whatever that means) then it can make macros glacially slow.\r\n\r\n2. The application\r\nI only tried two. With low values of the above setting I got poor results with my normal text editor, TextPad, yet pasting into Notepad still proved reliable."/>
<TEXT TYPE Action="1" Text="x"/>
<END REPEAT/>
<TEXT TYPE Action="0" Text="<SHIFT><HOME>"/>
<DELAY Flags="\x02" Time="100"/>
<TEXT TYPE Action="0" Text="<CONTROL>c"/>
<DELAY Flags="\x02" Time="100"/>
<VARIABLE SET STRING Option="\x02" Destination="ActualTextPasted"/>
<VARIABLE SET INTEGER Option="\x0D" Destination="ActualNumberOfPastes" Text_Variable="%ActualTextPasted%"/>
<TEXT TYPE Action="0" Text="<END><ENTER>\r\n"/>
<DELAY Flags="\x02" Time="100"/>
<TEXT TYPE Action="0" Text="Number of 'x's  that should have been pasted = %Total%\r\nNumber that was pasted = %ActualNumberOfPastes%\r\n"/>
<DELAY Flags="\x02" Time="100"/>
<TEXT TYPE Action="0" Text="<ENTER><ENTER>"/>

 

--

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