Jump to content
Macro Express Forums

React on cancel button

Recommended Posts

This might work, depending on what windows and circumstances are involved:


Use the Macro Express mouse locator tool to find the boundaries of the Cancel button, that is, where is it on the screen?

Trigger a macro to start based on the window appearing.

Wait for Left Mouse Button Click.

Get mouse location and see if it is within the Cancel button area.


P.S. If the multiple choice menu was displayed by Macro Express itself (Create a Multiple Choice Menu), then ignore the above idea, because ME has the option to return the word Cancel to the macro.

Link to comment
Share on other sites

how is it possible to react if someone presses the cancel button e.g. on a multiple choice menu.

There are a few ways to do this. Here is what I suggest:

Variable Set String %Choice% to "CANCEL" // Set a default value for the Choice variable used in the Multiple Choice Menu command
Multiple Choice Menu: Choose something // use %Choice% for the Destination Variable
If Variable %Choice% Equals "CANCEL"
// The CANCEL button was clicked
End If
If Variable %Choice% Equals "A"
// Option A was chosen
End If
If Variable %Choice% Equals "B"
// Option B was chosen
End If

In the On Error tab of the Multiple Choice Menu command look for "The dialog was cancelled" and choose "Ignore Error".


Of course you will need to change the If statements if you use the "Save Item Text" and/or "Multiple Choice" options in the Multiple Choice Menu command

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.

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.

  • Create New...