Jump to content
Macro Express Forums

Repeat macro syntax... I'm an idiot.


Recommended Posts

I like to think of myself as a reasonably intelligent person, but for some reason when I start trying to figure out the arguments and commands to repeat a macro, drool runs out of the corners of my mouth and I suddenly wish I paid more attention in high school math classes. Simply put, I am copying values line by line from a text file over into a text entry box on a webpage. I have the mouse positions and keyboard strokes perfectly setup - all I need to do is have this macro run for X amount of times. I see the entry points for this in the repeat start commands, but I start getting mega lost when integers and variables start getting tossed around. I poked around the forums and some of the videos, but none of them seem to match what I'm trying to do. 

 

This is a really simple request, but I feel like the application could do a better job holding layman's hands a little more than it does. The verbiage makes perfect sense to people who are comfortable writing formulas, code, whatever you want to call it, but this is pretty damn confusing from where I'm sitting right now. Definitely worth a buy, but I would be stoked if someone could help me out here. 

Link to comment
Share on other sites

I'm not a programmer, so others can probably give better answers...  

I think most implementations have

 

Repeat Until

Some steps to do

End Repeat.  

 

This loops until the "repeat until" is satisfied.

You can also have conditional exit points inside the loop.

 

Repeat Until

Some steps to do

-Does %Var% = XYZ?

---if yes, Break

---otherwise keep going

End Repeat. 

 

In the Sample Macros file that ships with MEpro is a macro called Repeat Until that uses this "if yes, Break" setup.  You can open and dissect it.  Note Also:  MEp has a pretty good context-sensitive help system.  SO you can (for example) click on the End Repeat command in the code or in the list of commands, and press the <F1> button.  That section of the help file will popup.  

 

Link to comment
Share on other sites

You're reading a file line by line then you should be using Text File Process or ASCII File Process. No integers. The number of loops is dictated by the number of lines in the file

Link to comment
Share on other sites

1 hour ago, Cory said:

You're reading a file line by line then you should be using Text File Process or ASCII File Process. No integers. The number of loops is dictated by the number of lines in the file

I'm taking a line and putting it into an entry area on a website, but then I have to clear what was put in there before adding another line. Not sure if this will work since it doesn't seem like the same scenario that you would normally for what you described. 

Link to comment
Share on other sites

A simple way to repeat, if you know the number of repetitions, is this:

Repeat Start (Repeat 10 times)
// Do something
End Repeat

 

Test this code, which repeats the action ten times, by copying the text below and pasting it directly into the Macro Express Script Editor. Sandwich your own commands between the "Repeat Start" and "End Repeat" statements. You might find it helpful to insert a delay of, for example, 1 second inside the loop, to better see what is happening when you run the macro.

<REPEAT START Start="1" Step="1" Count="10" Save="FALSE"/>
<COMMENT Value="Do something"/>
<END REPEAT/>	

 

Link to comment
Share on other sites

I haven't worked with variable arrays, but I wonder if this would be a good use for one.  Like collecting and storing all the lines of text, and then going to the web page and entering them all.  ...as opposed to getting a line of text, making your browser active, pasting in the single line of text, going back to your text file, and so on. 

 

When you say you're entering them in "a text entry box" on a webpage, what do you mean?  Is it a series of boxes, and one line of text for each box; or do you paste the value, then click a button, then paste the next value into the same box?  I think the second one would be much slower.  

 

Edit:  I see now (from your second post) that it is the latter.   Probably you have to press <Tab> then <Enter>.  You may also have discovered that Shift+Tab jumps you back up to the text box.  Depending on the website, there might be ways to have MacEx wait for the site to be ready for the next entry.  Maybe the window title changes, or maybe the text cursor changes.

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