Jump to content
Macro Express Forums

UAMike

Members
  • Posts

    57
  • Joined

  • Last visited

Posts posted by UAMike

  1. I am trying to figure out a more reliable way to type text. Currently, I have blocks of text set to variables and I am using the textype function. While this works most of the time, if I have a longer macro and/or hardware/software lag issues, I have found that typing one keystroke at a time can be unreliable. I was thinking that a better solution might be to set the clipboard text to my variable and then use the clipboard paste function. Is there a way to do this? I am not sure if any of the clipboard functions in MEX Pro do this. I am want to do something like 'Variable Set String from Clipboard" -- only the reverse of that.

     

    Thanks in advance.

  2. I am needing to create macros to mimic some complex decision trees that I use at work. The way that I have it set up right now is that the macro prompts the user to answer yes/no questions, enter values, pick from a multiple choice list... then the macro will spit out an answer.

     

    I find this process rather tedious to answer about 10 popup questions to reach my answer. Not only that, but I often make errors or change my mind about how to answer certain questions and have to start over from the beginning. My question to you is... is there a better/more intuitive way to approach this? I wish I could at least run backwards through the macro so that I could correct input errors instead of starting over from the beginning, but I cannot wrap my head around how to tackle that problem. I've briefly looked into creating a form that would ask all the questions in one place, but I believe that would require me to write and run an external script, which is currently outside of my capabilities.

     

    TIA

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

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

  5. 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"/>

  6. If you have the entire page in a variable you can use the "Variable Set Integer to the position of" command to search for something in front of the name and something after the name. Something like this might get you started:

    Variable Set Integer %Idx% to the position of "First Name:" in %sTemp% // Find "First Name:" in the input string
    Variable Modify Integer: %Idx% = %Idx% + 10 // Adjust the idx to skip over "First Name:"
    Variable Modify String: Copy a substring in %sTemp%, starting at %Idx% and 99999 characters long to %FirstName% // Copy from the first name to the end of the string
    
    

    This is not complete. You will have to determine what characters follow the First Name and then do another Variable Modify String: Copy a substring command.

     

    Thanks for this bit of advice, Samrae. Will this work if the only thing that appears after the first name is a bunch of blank spaces? Or does it need to be a distinct character?

    The way that the web page looks when its is copied to the clipboard and set to a variable is something like "First Name: Michael Last name: Jones". Based on this predictable pattern, maybe I can make it find the letter 'L' as the marker to modify the string?

  7. Hi all,

    I am trying to create a macro to help out with work. I have very basic programming knowledge from a few high school classes and I have seen this topic sort of addressed a few times (Cory always brought up Regex), but I want to see if I am not going about this the right way.

     

    I have a bunch of text on a web page that gets highlighted with crtl+a and then saved to a variable. I can then read variable and use "if variable contains xyz, variable2 = A. From there I can I just keep searching for key phrases from the text and setting them into new variables. This works fine for things that are "multiple choice" so to speak, but will not work for things like people's names, since it will be completely random what the name is.

     

    To get around this, I tried the approach of having the mouse click in selected spots where the words I am looking for will be and copying to clipboard, then setting variable from clipboard. This doesn't work all the time because little discrepancies in the changing web page make it so that I am always off by a few (or sometimes many) pixels.

     

    Any ideas here? I was thinking about revisiting my first approach when I just search for phrases in the variable... something like "if variable contains "FIRST NAME: *********" where the ***s are the person's actual name. I would only want to store this info into a new variable though, and not all the extraneous text in the variable. Can this be done?

     

    TIA,

    Mike

×
×
  • Create New...