Jump to content
Macro Express Forums

Macro Inserts text out of order


Recommended Posts

Re:  The following macro:

(Line 1)  Variable Restore All Variables
(Line 2)  Text Type:

<ENTER>


(Line 3)  Text Type: %T1%:<SPACE><SPACE>
(Line 4)  Text Type: (Msg #%T9%)<ENTER>
(Line 5)  Text Type: <SHIFT><INSERT><ENTER>
(Line 6)  Text Type:

<ENTER>

 

My problem is that the macro executes Line 6 before executing Line 5.

 

I'm running this in Windows 10.  Macro Express is V3.11.1.1  The macro is one of many I use when writing posts on the Forumania forum.

Line 1 makes the variables available for use

Line 2 enters the command

and moves to the next line



Line 3 enters the name of the person to whom the post is addressed (T1)

Line 4 enters the forum URL where the message to which I'm responding can be found (T8) and lists its message number (T9)

Line 5 copies the backquote from the clipboard into the message and moves to the next line

Line 6 enters the command

and moves to the next line

 

Does anyone know how to fix this?

 

Thanks for your help.

 

GDZ

 

 

Link to comment
Share on other sites

1. Do you have Dragon running on your system? Dragon appears to intercept the Insert key and use it for internal purposes.

2. Are you testing your script in Microsoft Word? Word can be set to map the Insert key to Paste, which causes all sorts of mischief.

 

Whether these two conditions are true or not, try changing <SHIFT><INSERT>  to <CONTROL>v, or substitute the Clipboard Paste command.

 

I'm not clear why you need to use the clipboard. Couldn't you use the Text Type command to insert the "backquote" character or characters?

Link to comment
Share on other sites

I don't fully understand what you are doing, but I wonder if the macro is typing things faster than the application or web form can accept them.  You could try putting a one second delay between each TYPE command, and see if the problem goes away.  Then start removing the delays, one at a time, until you determine which one(s) are overrunning the application. 

Link to comment
Share on other sites

acantor and rberq:

 

To answer your questions:

I'm not using Dragon.

 

I'm not using Word.  I'm copying text from a post that appears in Chrome and pasting it into a Chrome webpage similar to what I'm writing in right now.

 

The "backquote" is pure text, from a single sentence to several paragraphs of text written previously.  

 

The macro got all screwed up when I tried to reproduce it here so following is a screenshot of it"

 

403483321_ProblemMacro.jpg.ad5c3deed6f091a01f4af20226f6672b.jpg

 

Variable T1 is the name of the person to whom I'm writing that was captured in an earlier macro.

Variable T8 is the URL of the post I'm responding to that was captured in an earlier macro.

Variable T9 is the forum message number.

Variable T8 and T9 formk to the message being replied to

 

Following is a screenshot of the results of the macro.

 

1434588813_backquotesample.jpg.6f435b172e2179b282d6f9e088ac2880.jpg

 

After I wrote my first message, I realized that my version of Macro Express is out of date.  I have purchased an upgrade but not yet installed it.  As soon as I can get it installed and test this macro, I'll let you know if that makes any difference.  

 

Thanks for your help.

 

GDZ

Link to comment
Share on other sites

All:

 

Unfortunately, upgrading has the same problem.  At acantor's suggestion, I used the "Clipboard Paste" command but the problem was the same; the [/QUOTE] command was inserted before the text was placed in the post. 

 

By inserting a delay of 750 milliseconds, it worked okay on the test I was running.  Following is the code as used and the results:

 

B.jpg.1eb115fce2446f7155052c75b92af311.jpg

 

A.jpg.347038cb5a62b50f7091daf376bd8623.jpg

 

I'm not sure how the "delay" command works.  I guess it's possible that if inserting a long text block, it might put the "end-quote" command in the middle of the text.  Time will tell, I guess.

 

I wish Macro Express had a command that held up further processing of the macro until all commands prior to that command had completed.  If there is such a command, I'm unaware of it.

 

Comments anyone?

 

GDZ

Link to comment
Share on other sites

1 hour ago, GDZ said:

By inserting a delay of 750 milliseconds, it worked okay on the test I was running.

 

Clipboard copy and paste are Windows functions, and Macro Express can't really tell when they will finish.  They can be problematical in macros.  After all, ME is simply entering the Ctlr-v to paste, like you would enter it from the keyboard.  Doing it manually, you watch the screen and naturally you don't go on to the next step until the pasting is complete.  But ME has no inherent way to watch for completion, unless you program it into your script. 

 

Depending where the data is copied from, and where it is going, Windows does lots of work to format it for the target location.  For an example, go to this web page, do Ctlr-a to highlight the whole page including images, Ctrl-c to copy, then Ctrl-v to paste into Microsoft Word.  On my machine, the paste takes almost three seconds.   

https://forecast.weather.gov/MapClick.php?lat=41.7638&lon=-72.6739

Link to comment
Share on other sites

rberq:

 

>>>But ME has no inherent way to watch for completion, unless you program it into your script.<<<

 

Is there a way to do that? 

 

Additionally, would there be anything to gain by saving the text to a text variable and then have it posted from the variable instead of the clipboard?

 

Thanks for your help.

 

GDZ

 

 

 

Link to comment
Share on other sites

55 minutes ago, GDZ said:

would there be anything to gain by saving the text to a text variable and then have it posted from the variable instead of the clipboard?

 

For small amounts of text, it is practical to use Text Type to type the text in from a variable.  Typing will be slower than using the clipboard, but perhaps more reliable and predictable.  Just don't set the keystroke speed so fast that the "typing" overruns how fast Windows and the application can accept keystrokes. 

 

Keystroke Speed: 10 Milliseconds

 

There is a Macro Express "Preference" that applies an automatic time delay after each ME clipboard action.  I haven't found it very useful, because to rely on it you must set it for the worst possible case (longest delay you will EVER need), and that will penalize the many macros that need very short delays.  Probably better to use a delay command following the clipboard command, as you did, because you can tailor each delay to the particular situation. 

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