I have a macro that steps vertically down a line of pixels to find the lower edge "Y" of a varying height feature that I want to capture off a webpage. That part works fine. Then I need to calculate the height of the capture area and pass it to my capture program.
Let>H=Y-241
Run Program>C:\captureprog.exe x:3 y:240 w:600 h:%H%
By putting a message line after the Let> I can see it works OK, but unless I put a Wait> between the Let and the Run Program> I seem to get random values in the %H%. With a Wait>2 it works prefectly.
Am I passing the parameter incorrectly? Or should I just be happy it works with the Wait> in there?
Passing Parameters to a Run Program>
Moderators: Dorian (MJT support), JRL
Re: Passing Parameters to a Run Program>
What you have should work.
You could try:
Let>H=%Y%-241
How large is the "wait" you use when it works? You can use more than an integer:
Wait>0.5
(etc)
If you *seem* to get random values with H, perhaps it's because you're getting values of Y that you're not expecting?
You could try:
Let>H=%Y%-241
How large is the "wait" you use when it works? You can use more than an integer:
Wait>0.5
(etc)
If you *seem* to get random values with H, perhaps it's because you're getting values of Y that you're not expecting?
Re: Passing Parameters to a Run Program>
Wait>2 works every time. I didn't know I could Wait> less than 1, I'll try some shorter times tonight and see what happens.Captive wrote:What you have should work.
How large is the "wait" you use when it works? You can use more than an integer:
Wait>0.5
If I substitute a message displaying Y and H it always shows correct numbers. The page I'm loading (NWS Forecast) only changes twice a day so it's not like trying to hit a moving target in a game. I'm using the IE.busy code from this http://www.mjtnet.com/usergroup/viewtopic.php?t=1305 thread so I know the page is fully loaded.If you *seem* to get random values with H, perhaps it's because you're getting values of Y that you're not expecting?