Jump to content
Macro Express Forums


  • Content Count

  • Joined

  • Last visited

  • Days Won


Posts posted by Samrae

  1. I was able to do it this way:


    1. Create a new macro containing only a Text Type command using the Paste Rich Text option.

    2. From within the Macro Express Script Editor click View, Direct Editor.

    3. Highlighted and copied the text.

    4. Opened a Text Editor program. (Notepad would work.)

    5. Pasted the text based macro.

    6. Saved the text file.


    7. Created another new macro.

    8. Put in an Activate/Launch command to load WordPad. (Because WordPad can display Rich Text.)

    9. Put a Delay command after Activate/Launch.

    10. Put Load Macro Text File command

    11. Saved the macro.


    When this macro runs it launches WordPad and Text Types the Rich Text.




    There is a Paste Rich Text option in the Text Type command.

  2. To save the mouse position:

    Variable Set Integer %X%: Set to the Mouse X Coordinate
    Variable Set Integer %Y%: Set to the Mouse Y Coordinate

    To get the color of the pixel under the mouse use:

    Get Pixel Color from Beneath the Mouse into Color

    You can also get the color of a pixel without moving the mouse:

    Get Pixel Color at (125, 257) Relative to Current Window into Color

    To move the mouse back to the original location use:

    Mouse Move: %X%, %Y% Relative to Screen

  3. Which commands would I need to use to capture text from a field on a form and then have a specific macro run based on the text from that field?

    When asking a new question it is better to start a new topic.


    I can think of two ways to get text from a field on a form. If you are able to use a control you could use the Variable Get Control Text command. If controls won't work then you need to use the clipboard. Highlight the text and Text Type <CTRL>c to copy. Then use the Variable Set String from Clipboard. Once the information is in a variable you can use the If Variable command to have your macro do different things.

  4. Maybe this:

    If not control %C1% visible
     Macro Stop
    End if

    or this:

    If control %C1% visible
     Mouse double left click on control %C1%
     Delay 3 secs
     Macro Run: macro name
    End if

    But, I think if the control never becomes visible that this command:

    Wait for control %C1% to be come visible

    would fail and halt the macro.


    Keep in mind that sometimes (often?) controls behave weirdly. You may not be able to see a control but it may be visible to Windows (and consequently to Macro Express). You have to test your application and adjust your macros accordingly.

  5. The Expand the filename option was discussed previously: Expand filename: what does it do? This option changes a relative file path to a fully qualified pathname.


    If the current directory is set to "C:\Program Files\Macro Express Pro" and the filepath set to '..\Common Files', Expand the filepath will change it to "C:\Program Files\Common Files". Expanding a path of "\Program Files" will add the drive letter resulting in "C:\Program Files".


    There's no mention of this option in the Help for the command.

    I have submitted a bug report to Insight Software so they can update the help.

  6. I really hope that Insight would change their mind and turn their heads back and focusing on helping users (like myself) directly with their problems.

    Have you even tried their support? Just because they do not post here does not mean they are not "focused on helping users directly with their problems." Their support seems very clear to me: Reporting bugs and requesting features.


    Insight has been helpful whenever I have asked them for support. You should send them an email or call them.

  7. When trying to slow down as in the example it doesn't work. When writing 4 ( <MACRO PLAYBACK SPEED Speed="4"/> ) it says: Macro Playback Speed: 0,25 times faster than normal in the script.

    The Macro Playback Speed command only changes the delays in your macro. If you have no delays, the speed will not change.


    If you have questions about this I recommend you contact Insight's support people. They are very responsive to direct requests.

  8. To be useful to others, an attached file should be an MEX file, not an MXE.

    Why do you say that? An .MXE file can be imported into a macro file just as easily as a .MEX file, can't it?


    If we are expressing opinions, I think it makes things easier to include the text of your macro in your post so people can read what it does without having to take extra steps to import the macro first. It is easier and faster to know what is going on by seeing this:

    Window Activate: Microsoft Word

    instead of this:

    <WINDOW ACTIVATE Title="Microsoft Word" Exact_Match="FALSE" Wildcards="FALSE" _IGNORE="0x0006"/>

    For those who don't know, 'Copy Command Text' in the context menu copies the script in text.

  9. I have a need to read files where the mex file is located

    Try this:

    Variable Set From Misc:  "Current Macro File" into %MacroFilePath%
    Variable Set From File path
    Text Box Display: Result

    <VARIABLE SET FROM MISC Destination="%MacroFilePath%" Value="Current Macro File"/>
    <VARIABLE SET FROM FILE Filename="%MacroFilePath%" Option="\x01" Drive="%Drive%" Path="%Path%" Expand="FALSE" Flags="\x03"/>
    <TEXT BOX DISPLAY Title="Result" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs16 %MacroFilePath%\r\n\\par %Drive%%Path%\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="866" Height="118" Monitor="0" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/>

  10. Yes, this is possible. But it requires a technique that may be more complicated than using .INI files or the registry.


    Macro Express has the ability to run a macro that is contained in a text macro file. The text macro file can be modified by Macro Express or by another separate process. To set this up do the following:

    • Create new macro
    • Put Variable Set String %printJob% to "A" in it
    • Click View and Direct Editor
    • Copy the macro command
    • Paste into a text file. I would save it in the same folder where your other macro files are located.

    This gives a sample of the ASCII text syntax for the macro command.


    In your macro that contains the Multiple Choice Menu command put in a Load Macro Text File file command using the path to the text file you created above.


    Now, as your regular macro runs you can modify the text macro file to set %printJob% to B or some other value as needed.


    You can put as much or as little of your macro into the separate text macro file as you wish. This requires a separate text macro file, not much different than having an INI file.


    I would just create an .INI file in the Temp folder (use %TEMP% in the path) and save the variables in it. Many programs store stuff in the Temp folder.

  11. ... after each report I need to add another down to select the next date to run. Today (down) 11/3/2011 (down) 11/2/2011 etc.

    Can you type the date instead of pressing arrow down? If so, you could have the macro type 3/4/2010, 3/5/2011, etc. This is likely to be more reliable than 730 arrow down keys. There are commands to get day, month and year and put into integer variables that can by typed.

  12. Why doesn't the macro work with the protected pdf document?

    Some programs disable the keyboard hooks when asking for a password. This keeps key loggers and other bad software from capturing your password. But it also ignores keystrokes from Macro Express.

  13. Perhaps simplest would be to do this:

    // Save position of mouse
    Variable Set Integer %X%: Set to the Mouse X Coordinate
    Variable Set Integer %Y%: Set to the Mouse Y Coordinate
    Text Type (Simulate Keystrokes): <ALTD>d<ALTU>
    Delay: 0.1 seconds
    Text Type (Simulate Keystrokes): <CTRLD>c<CTRLU>
    Delay: 0.1 seconds
    Variable Set String %URL% from the clipboard contents
    // Restore position of mouse
    Mouse Move: %X%, %Y% Relative to Screen
    Delay: %Delay% seconds
    Mouse Left Click

    This moves the mouse but moves it back.

  14. I have a macro that does this. When it runs it looks in the registry for a name. If it is not found, it asks the user for the name and stores it in the registry. This feature runs at the beginning of a macro that they use anyway. If you save the name in the HKEY_CURRENT_USER area of the registry it will be unique for each user that logs on to a computer.


    Another idea would be to get the name of the logged on user from Windows using the Variable Set From Misc/Set Variable %T1% to "Username" command.

  • Create New...