Jump to content
Macro Express Forums

Odd macro behaviour..


PotterHarry

Recommended Posts

Hi there, I am running a macro which opens a web page and scans for certain colours, which will prompt actions further down the macro. I wanted to test this by leaving it running all day, and getting it to check the page every ten minutes or so. I set up a repeat, until loop. Within this section there is a Run Macro "Web". It won't work. It runs through it once and then stops. I substituted Run Macro "Web" with Run Macro "Beep" (A short macro which beeps to indicate it has occured), and that works fine every time. I checked to make sure I am not using the same conflicting variables, and I am wondering... the Web Macro in turn calls other short macros. Is there a possibility that this is the reason for its failure? Thank you.

Link to comment
Share on other sites

Thanks, rberq. It didn't but now it does! I have put Macro Stop commands at the end of all the sub-macros. Problem persists. I know the culprit - it is some lines within macro "web". I am selectively disabling lines within it, and it runs with blocks of lines disabled. An odd thing happens. As the macro is running, I see macro express maximised, and then ME closes down, locking the XP desktop. ME disappears from the taskbar, and I have to re-launch it.

Link to comment
Share on other sites

Oops. I should have been more direct. Sub-macros should end with Macro Return, not with Macro Stop. At least that's the way it works for me. If I do Macro Run several times, and the sub-macro has a Macro Stop, then the whole process stops after the first execution of the sub-macro -- which matches your original symptoms.

Link to comment
Share on other sites

Thanks, rberq. It didn't but now it does! I have put Macro Stop commands at the end of all the sub-macros. Problem persists. I know the culprit - it is some lines within macro "web". I am selectively disabling lines within it, and it runs with blocks of lines disabled. An odd thing happens. As the macro is running, I see macro express maximised, and then ME closes down, locking the XP desktop. ME disappears from the taskbar, and I have to re-launch it.

 

If there is a "Macro Stop" at the end of your subroutines, I believe that the main macro that calls these subroutines will also stop.

 

But it sounds like there are other bugs, given your description of how your script is failing. My rule for debugging complex scripts -- and even simple ones that are misbehaving -- is to simplify, simplify, simplify. Ensure that the script does the first action correctly. Test and test and test. Add the next step. Test more. And so on.

 

My experience of developing complex scripts is that there may be many things that cause, or contribute to, each problem. It takes a lot of time and patience to sort things out.

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