Jump to content
Macro Express Forums

Stop A Macro


sbmichele
 Share

Recommended Posts

Hi all,

I don't know if it's possible to do this with ME:

 

I have a macro repeating 9999 times clicking and refreshing a web page.

At the same time I need to stop this macro and run another macro but I cannot coz the second macro cannot be activated coz the first one is still in action refreshing that page like crazy :)

What I would need is the option to stop the first one as the second one is activated by its short key but I cannot make it work.

Right now I'm just stopping the first one aborting it, have to wait for the "The macro has been aborted" message and then I execute the second one.... a big waste of time and I'm sure there is a better way to do this.

I'd be pleased If anyone has any ideas.

 

Regards,

MIchele

Link to comment
Share on other sites

Assume you've got M1 running and would like M1 to be interrupted while you

run M2.

 

Now, you can't actually run 2 macros at once. However you could easily create a new window via a shortcut (say a command prompt where the window title is "Special", and which doesn't actually do anything except EXIST). You could fire off this window via a click or double-click.

 

Now have macro M1 include in its loop (the one that repeats 9999 times) a check for the existence of a window called "Special". When this window exists, M1 stops refreshing the web page and fires off M2 instead. When M2 has completed, M1 closes the window called "Special" and resumes its Web page refreshing.

 

BTW, if you use either Opera or Firefox as your browser instead of ghastly, old and exploit-vulnerable IE, then either of these come with the ability to configure any specific page to "Refresh every nnn timeinterval". This might be a superior approach.

Link to comment
Share on other sites

  • 2 years later...

Another way, using the same principle Paul suggests, is to test for clipboard contents. For example:

 

// Breaking out of a long-running macro

// Start a loop that runs indefinitely...

// ...unless the text in the clipboard is 'StopMacro'

Repeat Until %N99% <> %N99%

// You could place 'StopMacro' on the clipboard anyway you wish.

// For example, type it in your text editor, or any dialog, and use Ctrl+c

If Clipboard Text Equals "StopMacro"

Break

End If

// All your commands here

Repeat End

// Any further commands when loop finished

Text Box Display: Loop has been exited

 

<REM2:Breaking out of a long-running macro><REM2:Start a loop that runs indefinitely...><REM2:...unless the text in the clipboard is 'StopMacro'><REP3:08:000002:000002:0099:1:01:N99><REM2:You could place 'StopMacro' on the clipboard anyway you wish.><REM2:For example, type it in your text editor, or any dialog, and use Ctrl+c><IFOTH2:07:1:StopMacro><BREAK><ENDIF><REM2:All your commands here><ENDREP><REM2:Any further commands when loop finished><TBOX4:T:4:CenterCenter000278000200:005:Loop has been exitedMacro will end when you press OK.

 

Don't forget to clear the clipboard or place some other text in it before you run the macro again.>

 

 

--

Terry, West Sussex, 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...
 Share

×
×
  • Create New...