Jump to content
Macro Express Forums

Multiple choice menu help


Recommended Posts

Hello,

 

I created a shortkey which is suposed to pop up a multiple choice menu, then set the user input to a variable, then output a string with the variable inside. Pretty simple... but I am trying to avoid moving my hand to the mouse to pick the multiple choice answer, so I tried accomplishing this with the Move Move and Mouse Left Click on the first answer (then I could just arrow down to the correct choice).

 

However, I am having mixed results with this method... sometimes the mouse moves, sometimes it doesn't. Sometimes I get a click, sometimes I don't :( . I tried adding some delays or 'wait for window title' in between steps to see if that does anything, but no help.

 

Any suggestions on how to accomplish this in a foolproof way?

 

<MULTIPLE CHOICE MENU Style="\x00" Result="\x01" Dest="%str%" Title="Dose" Prompt="Pick the correct dose" Options="2\r\n5\r\n10\r\n20" Left="Center" Top="Center" Monitor="0" Width="300" Height="200" OnTop="FALSE" Columns="Auto"/>

<MOUSE MOVE Option="\x01" X="823" Y="465" _PROMPT="0x000A"/>

<MOUSE LEFT CLICK/>

<TEXT TYPE Action="0" Text="The answer is %str%mg"/>

Link to comment
Share on other sites

Preselect a value in the multiple choice by setting the result value to that value before showing the menu. IE when the multiple choice pops up one will already be selected. Then you can arrow up and down to select different values. Enter to accept.

  • Like 3
Link to comment
Share on other sites

Also remember to check out the a&ccelerator key things...

from the help file (bottom of "Multiple Choice Menu" page):

===========

 

Multiple Choice Tips

Make one of the Multiple Choice selections the Default

Let's say you want option B to be your default selection. Use the Variable Set String command and select the Set Value Now option. Set the value of variable T1 to B. Insert this command before your Menu command in the macro script. When the macro runs, option B will display as the default selection.

Allow users to select a menu item with the keyboard instead of clicking with the mouse

Let's look at the Multiple Choice Menu image above. There are four entries in the Menu List. We want to set this up so that when the menu is displayed, the user can press a keystroke rather than click on their choice with the mouse. To do so we would modify the Menu List to look like the following:

A &Go to Macro Express web site

B &Run Notepad

C &Insert email tagline

D &Connect to FTP site

You'll notice that an ampersand "&" has been placed in front of each item in the menu list. When the list is displayed during playback of the macro, the letter following the ampersand "&" will be underlined. The user can then press the underlined letter for the choice they want. This will highlight their choice. Pressing the Enter key will perform the macro selection chosen.

The ampersand may be placed anywhere in the text string. It doesn't need to be placed before the first letter as in the example above. For example, we could set item A to read as follows: Go to &Macro Express web site. In this case the M will be underlined and pressing the "M" key during playback will highlight this menu option.

Note 1: Be careful not to duplicate the underlined letters. Otherwise the first duplicate letter will be the default choice each time the letter is pressed.

Note 2: If you are using the If Variable Contains command with the Multiple Choice Menu and you have “Save Item Text” checked, be sure to change the text you are comparing so that it includes the ampersand "&". For example, change “If Variable %T1% contains "Choice One" to “If Variable %T1% contains "&Choice One".

Note 3: To insert an ampersand in the text that is not used as an accelerator, such as a menu item of "This & That", insert two ampersand symbols. Write the menu item as "This && That", so that it displays correctly when the macro runs.

  • Like 3
Link to comment
Share on other sites

AFAIK, the macro will not run your Mouse Move command while it's waiting for a response to the open Multiple Choice menu. (So I'm surprised that you say it sometimes does!)

 

BTW, is it your intention to always Text Type the result at the current text cursor in the current window? Perhaps a Text Display command would be a more flexible alternative?

 

--
Terry, East Grinstead, UK

Link to comment
Share on other sites

Hello,

 

I created a shortkey which is suposed to pop up a multiple choice menu, then set the user input to a variable, then output a string with the variable inside. Pretty simple... but I am trying to avoid moving my hand to the mouse to pick the multiple choice answer, so I tried accomplishing this with the Move Move and Mouse Left Click on the first answer (then I could just arrow down to the correct choice).

 

However, I am having mixed results with this method... sometimes the mouse moves, sometimes it doesn't. Sometimes I get a click, sometimes I don't :( . I tried adding some delays or 'wait for window title' in between steps to see if that does anything, but no help.

 

Any suggestions on how to accomplish this in a foolproof way?

 

<MULTIPLE CHOICE MENU Style="\x00" Result="\x01" Dest="%str%" Title="Dose" Prompt="Pick the correct dose" Options="2\r\n5\r\n10\r\n20" Left="Center" Top="Center" Monitor="0" Width="300" Height="200" OnTop="FALSE" Columns="Auto"/>

<MOUSE MOVE Option="\x01" X="823" Y="465" _PROMPT="0x000A"/>

<MOUSE LEFT CLICK/>

<TEXT TYPE Action="0" Text="The answer is %str%mg"/>

 

 

Preselect a value in the multiple choice by setting the result value to that value before showing the menu. IE when the multiple choice pops up one will already be selected. Then you can arrow up and down to select different values. Enter to accept.

 

 

Also remember to check out the a&ccelerator key things...

from the help file (bottom of "Multiple Choice Menu" page):

===========

 

Multiple Choice Tips

 

Make one of the Multiple Choice selections the Default

Let's say you want option B to be your default selection. Use the Variable Set String command and select the Set Value Now option. Set the value of variable T1 to B. Insert this command before your Menu command in the macro script. When the macro runs, option B will display as the default selection.

 

Allow users to select a menu item with the keyboard instead of clicking with the mouse

Let's look at the Multiple Choice Menu image above. There are four entries in the Menu List. We want to set this up so that when the menu is displayed, the user can press a keystroke rather than click on their choice with the mouse. To do so we would modify the Menu List to look like the following:

 

A &Go to Macro Express web site

B &Run Notepad

C &Insert email tagline

D &Connect to FTP site

 

You'll notice that an ampersand "&" has been placed in front of each item in the menu list. When the list is displayed during playback of the macro, the letter following the ampersand "&" will be underlined. The user can then press the underlined letter for the choice they want. This will highlight their choice. Pressing the Enter key will perform the macro selection chosen.

 

The ampersand may be placed anywhere in the text string. It doesn't need to be placed before the first letter as in the example above. For example, we could set item A to read as follows: Go to &Macro Express web site. In this case the M will be underlined and pressing the "M" key during playback will highlight this menu option.

 

Note 1: Be careful not to duplicate the underlined letters. Otherwise the first duplicate letter will be the default choice each time the letter is pressed.

 

Note 2: If you are using the If Variable Contains command with the Multiple Choice Menu and you have “Save Item Text” checked, be sure to change the text you are comparing so that it includes the ampersand "&". For example, change “If Variable %T1% contains "Choice One" to “If Variable %T1% contains "&Choice One".

 

Note 3: To insert an ampersand in the text that is not used as an accelerator, such as a menu item of "This & That", insert two ampersand symbols. Write the menu item as "This && That", so that it displays correctly when the macro runs.

@Cory @steveK Thanks for this... my carpal tunnel is in debt to you :)

 

@terrypin that is a mystery but it does somewhat explain why the mouse moved less than half the time. And no, the text output was not always where I wanted to set the cursor to, it was just a starting point so that I didn't have to mouse to the correct answer. thanks!

Link to comment
Share on other sites

I give the answer he seeks in 4 minutes and SteveK gets "best answer"? Not even a thanks? Pfft.

Sorry Cory, I was just replying to all as you posted. I actually did end up using your method since I saw it first... I just thought that the other answer gave more options. Not too familiar with the rep that goes into forums... didn't know it was a big deal. sorry

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