Jump to content
Macro Express Forums

rberq

Members
  • Posts

    1,200
  • Joined

  • Last visited

  • Days Won

    61

Posts posted by rberq

  1. 3 hours ago, Cory said:

    One can't type an actual tab in most MEP commands or dialogs, but they can be pasted in and exist as I pointed out in my link, so if there is an actual 0x09 coded character, I think MEP will type it with the Text Type command. 

     

    The example frateg8r gave just happened to have TAB and BACKSPACE, for which Macro Express has mnemonics <TAB> and <BACKSPACE> that can be typed.  For other special characters, the ASCII values can be inserted as you describe, and Macro Express will type them, or they can be embedded in text that will be properly interpreted by Notepad, etc.  Here's a list of several I have used for various reasons.
     
    // BEL character ascii 7
    Variable Set to ASCII Char 7 to %BEL%

     

    // Escape character ascii 27
    Variable Set to ASCII Char 27 to %ESC%

     

    // Tab character ascii 9
    Variable Set to ASCII Char 9 to %TAB%

     

    // Line Feed (New Line) character ascii 10
    Variable Set to ASCII Char 10 to %LINEFEED%

     

    // Carriage Return character ascii 13
    Variable Set to ASCII Char 13 to %CARRIAGERETURN%

     

    // Carriage Return / Line Feed combination characters ascii 13 + ascii 10
    Variable Set to ASCII Char 13 to %CRLF%
    Variable Modify String %CRLF%: Append Text String Variable (%LINEFEED%)

     

    // STX character ascii 2
    Variable Set to ASCII Char 2 to %STX%

     

    // ETX character ascii 3
    Variable Set to ASCII Char 3 to %ETX%

     

    // DC1 character ascii 17
    Variable Set to ASCII Char 17 to %DC1%

     

    // DC2 character ascii 18
    Variable Set to ASCII Char 18 to %DC2%
     

     

    • Like 1
  2. I'm not sure its this simple, but try this:

     

    This macro takes whatever is in the clipboard, puts it into a variable, then converts the special characters to Macro Express's format, then "types" the converted text.  

    {#key BACKSPACE#}{#key BACKSPACE#}{#key TAB#}72422346833{#key TAB#}WAW22080013{#key TAB#}{#key TAB#}{#key TAB#}{#key TAB#}1{#key TAB#}{#key TAB#}

    is changed to

    <BACKSPACE><BACKSPACE><TAB>72422346833<TAB>WAW22080013<TAB><TAB><TAB><TAB>1<TAB><TAB>

     

    Variable Set String %text% from the clipboard contents
    Variable Modify String: Replace "{#key BACKSPACE#}" in %text% with "<BACKSPACE>"
    Variable Modify String: Replace "{#key TAB#}" in %text% with "<TAB>"
    Text Type (Simulate Keystrokes): %text%

     

    • Like 1
  3. 3 hours ago, Sgordet said:

    I have moved on; I am happy with my HotKey solution

    You don't think that will shut us up, do you?😋 😋😋  Us OCD guys (speaking for myself, others may be normal) are like a dog with an old sock, we'll keep shaking around your original question until we get all the goodness out of it. 

     

    Seriously, is sounds like you are using a variety of tools to really make the computer work for you.  Good move.  I always told people Macro Express was worth half a person in time savings.  Pretty easy to justify the $35 investment I made to buy the software, way back when.  Macro Express plus the other tools probably multiply your productivity several times over, not just half a person's worth. 

  4. 6 hours ago, acantor said:

    but only if you recruit the middle button instead of the left or the right button.

     

    acantor, thanks for testing this.  I hadn't figured out how to use the Catch Error command.  But following your example, the macro below works well.  

     

    However, I'm not sure what you mean about needing to use the middle or right mouse button.  This macro is started by single-clicking the left button in a designated are of the screen.  If the user single-clicks, Catch Error ends the macro (Macro Return) without doing anything further, and the user never knows it has run.  If the user double-clicks, then the macro continues and can do its business.  

     

    (However, if the double-click location is a desktop icon that starts some other program, the other program doesn't start, at least on my PC.  It is as if ME steals the second click, and Windows highlights the icon but doesn't start the program.)    

     

    //  
    Wait for Left Mouse Click
    On Error
      Catch Error: Condition was not met within the specified amount of time
        Macro Return
      End Catch Error
    End Error
    //  
    Text Box Display: ztest
    //  
    Macro Return


    <COMMENT Value=" "/>
    <WAIT FOR LEFT MOUSE CLICK Indefinite="FALSE" Hours="0" Minutes="0" Seconds="1" _HANDLE="0x0014"/>
    <ON ERROR/>
    <CATCH ERROR Code="20"/>
    <MACRO RETURN/>
    <END CATCH ERROR/>
    <END ERROR/>
    <COMMENT Value=" "/>
    <TEXT BOX DISPLAY Title="ztest" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20 ztest running\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/>
    <COMMENT Value=" "/>
    <MACRO RETURN/>

     

  5. Macro Express log of testing the above macro:

     

    SINGLE CLICK
    7/24/2022 4:51:38 PM: Macro Started (ztest)
    7/24/2022 4:51:38 PM: Line 1: Comment
    7/24/2022 4:51:38 PM: Line 2: Wait for Left Mouse Click
    7/24/2022 4:51:39 PM: Condition was not met within the specified amount of time
    7/24/2022 4:51:46 PM: Macro Completed (ztest)

     

    DOUBLE CLICK
    7/24/2022 4:51:47 PM: Macro Started (ztest)
    7/24/2022 4:51:47 PM: Line 1: Comment
    7/24/2022 4:51:47 PM: Line 2: Wait for Left Mouse Click
    7/24/2022 4:51:47 PM: Line 4: Text Box Display
    7/24/2022 4:51:50 PM: Line 5: Comment
    7/24/2022 4:51:50 PM: Line 6: Macro Return
    7/24/2022 4:51:50 PM: Macro Completed (ztest)

  6. OK, I tested it.  
    Single mouse click at the specified screen location starts the macro.
    Double mouse click starts the macro and the Text Box appears.
    Single mouse click without the second click results in Macro Express terminating the macro with an error message.  I'm not sure what you can do about the error message, as I doubt that you want it to appear on the screen. 

     

    //  
    Wait for Left Mouse Click
    //  
    Text Box Display: ztest
    //  
    Macro Return

     

  7. I don't remember the details, but I believe there is an option in the startup or the installation (or both) to prevent you from using the Editor.  I once had 350 users running pre-packaged macros, and the last thing I wanted them to do was play in the Editor.  ME was started via a .bat file when the PC was booted, and if I recall correctly, there was a command-line option. 

     

    If you have the software and the Windows rights to install it, you should be able to override whatever the admin people did. 

  8. Are you sure that the macro is even running?

     

    As a FIRST step, look at the macro with the Script Editor and insert a Text Box Display command at the beginning, displaying some simple message like "Macro is running".  Then when you play back the macro you should see the message pop up on the screen.  Once you confirm that it actually runs, we can look into what it is and isn't doing. 

  9. Date/Time: Set %dattim% to "12/28/2021 10:55:50 PM"
    Variable Modify Date/Time: Convert to Text String
    Text Box Display: dt
    Repeat Start (Repeat 10 times)
      Variable Modify Date/Time: %dattim% = %dattim% + 1 Days
      Variable Modify Date/Time: Convert to Text String
      Text Box Display: dt
    End Repeat
    Macro Return

     

    <DATE/TIME Flags="\xB1" Date="12/28/2021 10:55:50 PM" Day_Offset="0" Month_Offset="0" Year_Offset="0" Hour_Offset="0" Minute_Offset="0" Second_Offset="0" Left="Center" Top="Center" Monitor="0" Variable="%dattim%" IsDateVar="TRUE"/>
    <VARIABLE MODIFY DATE/TIME DateVar="%dattim%" Option="\x09" LeftVar="mm'-'dd'-'yyyy" RightVal="%dattimtext%" UseInteger="FALSE" MathOpt="\x00"/>
    <TEXT BOX DISPLAY Title="dt" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20 date = %dattim%\r\n\\par %dattimtext%\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/>
    <REPEAT START Start="1" Step="1" Count="10" Save="FALSE"/>
    <VARIABLE MODIFY DATE/TIME DateVar="%dattim%" Option="\x00" LeftVar="%dattim%" RightVal="1" UseInteger="FALSE" MathOpt="\x00"/>
    <VARIABLE MODIFY DATE/TIME DateVar="%dattim%" Option="\x09" LeftVar="mm'-'dd'-'yyyy" RightVal="%dattimtext%" UseInteger="FALSE" MathOpt="\x00"/>
    <TEXT BOX DISPLAY Title="dt" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20 date = %dattim%\r\n\\par %dattimtext%\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/>
    <END REPEAT/>
    <MACRO RETURN/>

     

  10. I have seen the problem where the initial letter that should be upper case types as lower case.  That was way back at Macro Express 3.  Sorry I don't remember the solution, but I think it had to do with the application into which the data was typed.  What is your application?  What Keystroke Speed is specified in your macro? 

     

    I can't reproduce your issue with ME Pro 4, typing into Notepad or Word. 

  11. If there is an elegant solution to do it within a macro, I have not found it.  It's a pain.  Somebody has probably written date-manipulation macros, and a search of these forums might find them. 

     

    I think there is a way to call a VB script from a macro, though I have never tried it.  There are probably VB functions that would do all the work for you. 

     

    Another way I think would work -- I am going to try this later because dates are such a pain:

    1) Manually, set up and store "permanently" an Excel spreadsheet with the first column formatted as dates. 

    2) In your macro, load the spreadsheet, transfer to it, and text-type your beginning date into cell A1.

    3) In cell A2, type "=A1-7" and Excel should take care of the math.  I believe the spreadsheet stores dates in some Microsoft-invented form, so you may have to use other spreadsheet functions to extract month/day/year in recognizable form.  Google is your friend for finding those functions.

    4) Copy the spreadsheet result cell(s) into the clipboard, close the spreadsheet, and the macro can use the clipboard values however you want.

  12. Unless ME has improved in versions later than mine, working with times is clumsy.  The "Variable Set Integer" command allows to you load month/day/year/hour/minute/second into variables.  One technique I have used is to convert the present date and time into an approximate number of seconds elapsed since the year zero and time zero.  That's simply a matter of multiplying minutes by 60, hours by 3600, days by 86400, and so on, and adding all the products together.  Of course this does not accurately account for leap years and the meddling of Pope Gregory, but for the 30 minutes you care about it's close enough.  You could do it at the beginning of your macro, and again during each repeat of the processing loop, thereby keeping all the logic within your single macro.  Simply subtract the initial stored value from the recomputed value, and you know how many seconds have elapsed.  

     

    Another command to look at is "Wait for time to elapse".  That you would have to do in a secondary macro, which would set the token you and Cory have been discussing.  

    A simple method is:

    1) Main macro deletes (token) file "c:\temp\timer.txt"

    2) Main macro starts secondary macro ("Macro Run" command -- don't wait for completion!!!)

    3) Secondary macro waits for 30 minutes to elapse, then creates file "c:\temp\timer.txt"

    4) Main macro checks periodically for the existence of file "c:\temp\timer.txt".  If the file exists, time's up

     

    I'm assuming that you don't need your time right down to the milli-second, because these techniques will have a little slop one way or the other.   

×
×
  • Create New...