Jump to content
Macro Express Forums

kevin

Admin
  • Posts

    1,950
  • Joined

  • Last visited

  • Days Won

    3

Posts posted by kevin

  1. Macro Express is unable to redirect ( > ) or pipe ( | ) output to stdout. To accomplish this you can create a batch (.bat) file and call it from the macro.

     

    You batch file should look like this:

    C:\Program Files\SyncToy 2.0\SyncToyCmd.exe -R > C:\logfile.log

     

    and your macro like this:

    post-8-1246039123_thumb.jpg

  2. Switch (T1)
     Case: Found
    Text Box Display: T1 contains Found
     End Case
    End Switch

     

    In this context, 'contains' means 'equals'. I understand how it could be confusing when you are comparing with the If statements. We will change the example to say 'T1 equals Found'.

  3. If you need to parse the content of each line into separate elements of an array use the ASCII File Begin/End Process commands. However, if, as seems to be the case here, you want each complete line, use the Text File Begin/End Process command. This would change Steve's macro to something like this (untested):

    Text File Begin Process: "C:\Documents and Settings\z051940\Desktop\Lines.txt" (Tab Delimited Text (.txt))
     Variable Set String %ModifiedProcess% to "%LineProcess% %LineProcess%"
     Variable Modify String: Append %ModifiedProcess% to text file, "C:\Documents and Settings\z051940\Desktop\Lines2.txt"
    Text File End Process
    Copy File/Files: "C:\Documents and Settings\z051940\Desktop\Lines2.txt" to "C:\Documents and Settings\z051940\Desktop\Lines.txt"
    Delete File/Files: "C:\Documents and Settings\z051940\Desktop\Lines2.txt"

  4. Check me on this, can't we effectively have both with suffix? I mean there's nothing to say that with the suffix option I couldn't have a shortkey ##cid, wight?

    There is a slight difference. With Prefix you would type '##cid' and with Suffix you would type '##cid '. Note the ending space.

    To explain fully for those following along, in this example, using Prefix the shortkey would be named 'cid', and the ## is defined in the Shortkeys Prefix Keys setting. Using Suffix the shortkey would be named '##cid'.

  5. Both are extremely useful. Suffix is good for typing shortcuts. Prefix is good for other tasks. I wish I could have one set of Prefix and another set of Suffix shortkeys.
    There are technical reasons why Macro Express only supports one at a time. But ...

     

    But since I have to choose ...
    You can have both. Our ShortKeys product has all the shortkey features of Macro Express plus a few more (Compare Products). You can run both programs at the same time and have Macro Express set to use Prefix and ShortKeys set to use Suffix (or vice versa).

     

    ShortKeys comes with a free 30 day trial. Or you may want to try ShortKeys Lite. This version is free for personal use but has a limit of 15 shortkeys.

    ShortKeys is a text replacement program without the same macro capabilities as Macro Express Pro. You can have it run a Macro Express Pro macro by typing the correct activation. If you try this and have difficulties let us know and we will help.

  6. Issues entered into the tracking system, either as a bug report or a feature request, are reviewed by developers, not support people. You may not receive a personal response. As stated on the Report a Bug and Request a Feature pages:

    You will not receive a personal email response unless we need more information.

    Do not use this form to submit technical support questions. Send questions to info@wintools.com.

    Our Technical Support people read and respond to each issue they receive in as timely a manner as possible. If a support issue is entered into the tracking system, it is forwarded to Technical Support. However, there may be a delay before this happens.

     

    If you want our developers to look at a problem or consider a feature then use the Report a Bug and Request a Feature pages. If you want a reply, response or a possible work-around, send your request to Technical Support.

  7. During my experimenting a few years ago with Dragon Naturally Speaking I discovered that Dragon was not sending hotkeys type sequences to windows thus preventing macro activation. The first step to determine what is going wrong would be to check to see if the macro is actually being activated.

     

    1. Create a macro that does something simple. Perhaps it should only play a sound file or display a Text Box.
    2. Assign your hotkey to it.
    3. Press the hotkey combination to make sure that you can activate it manually.
    4. Add the activation to Dragon Naturally Speaking and try it.

    If it works when you manually press the hotkey activation and it does not work when you try it from Dragon Naturally Speaking then the issue is with Dragon.

     

    If I recall correctly, when researching this I found that there are several (three?) versions of Dragon Naturally Speaking. The more expensive versions allowed hotkeys to activate macros in a macro program. The other versions did not.

     

    I believe Joe did some experimenting after I did and managed to find a work around. He got Dragon Naturally Speaking to write to a file or a registry entry and created a macro to watch for that and perform specific functions.

     

    After my discouraging results, I set the project aside and never got back to it. We would love to hear how this turns out.

  8. This should do it:

    Variable Set Integer %Serial% to 0 // Start with 0
    
    // Inside your loop
    Variable Modify Integer %Serial%: Convert to Text String (%SerialStr%)
    Variable Modify String %SerialStr%: Pad Left (4) // Pad to 4 characters (with spaces)
    Variable Modify String: Replace " " in %SerialStr% with "0" // Replace all spaces with 0's

  9. I thought you were asking how to get the 'Program Files (x86)' folder. Sorry.

     

    So, you're saying that you are writing a macro on a machine where the icon will be in

    c:\Program Files\Macro Express Pro\icons

     

    and another machine where they will be in:

    c:\Program Files (x86)\Macro Express Pro\icons

     

    You are right. There doesn't seem to be a way to make this portable. The solution would be to create a folder that will have the same name for all computers. Perhaps you should have a c:\macros folder and put the icons there or in something like c:\macros\icons.

     

    Your request has been added to our tracking system and assigned the tracking number [iSS7093].

  10. Have you tried clicking the checkbox 'Add Trailing CR/LF' in the Variable Modify String: Append %T13% to Text File command dialog?

     

    Here is another approach:

    Variable Set %T13% to ASCII Char of 13  // put CR in T13
    Variable Set %T10% to ASCII Char of 10  // put LF in T10
    Variable Set String %T13% "%T13%%T10%"  // put CRLF in T13
    Variable Modify String: Append %T13% to Text File // append to the file

  11. Is there any way to make a command for the following:

    Wait for window Title Change.

    This can be accomplish using existing macro commands. Try this:

    Variable Set Integer %N1% to 0   // initialize counter
    
    // Set both T1 and T2 to the window title with focus
    Variable Set String %T1% from Window Title
    Variable Modify String: Copy %T1% to %T2%
    
    // Repeat until the current window title changes or until 10 seconds have elapsed
    Repeat Until %T3% = "DONE"
     Wait Time Delay 0.5 Seconds  // Put Macro Express to sleep for 1/2 a second
     Variable Set String %T1% from Window Title
    
     Variable Modify Integer: Inc (%N1%)  // increment seconds counter
     If Variable %T1% <> variable %T2%
    OR
     If Variable %N1% > 20
    Variable Set String %T3% "DONE"  // set flag to exit the repeat loop
     End If
    
    Repeat End

    This code is provided as an example. I did not test it. If you need this in more than one place in your macros you could put it in a separate macro and use it via the Macro Run command.

  12. I've checked the task manager to see if MEP is still somehow running invisibly, but there is nothing listed that I can reasonably connect to MEP.

    These are the executables used by Macro Express Pro. Please check to see if any of them are running after the crash. Some may keep Macro Express Pro from loading but the others, later in the list, should not.

    • macexp.exe - Player
    • macedit.exe - Explorer
    • macscript.exe - Script Editor
    • caputil.exe - Capture utility used when capturing (recording) a macro
    • firsttime.exe - First time wizard
    • macmenu.exe - Menu builder
       
    • licprog.exe - Used to enter the license when running on Vista
    • macdef.exe - Resets the preferences to their default values
    • meproc.exe - Passes command line parameters to the player
    • meproc64.exe - Gets information from 64 bit processes
    • mslocate.exe - Mouse locator
    • quickwiz.exe - Quick Wizards
    • restart_macexp.exe - Restarts Macro Express Pro

  13. Macro Express uses the Windows hooks to perform mouse movements and mouse clicks. The hooks are in a 'chain' meaning one program passes the mouse events on to the next. Any program that inserts itself into the hook chain has the ability to prevent any other program from seeing any of the mouse events. The same thing applies to keystrokes.

     

    Some programs intentionally block mouse or keyboard messages. One reason may be to provide security and to block malware programs that watch for mouse events and keystrokes (keyloggers). Other programs try to prevent automation (such as games). And still other programs have errors in how they interact with the hook chain.

  14. You may be able to do a Text Type Ctrl-v when the drop down is active to copy the current selection to the clipboard. The macro can then decide if more down arrows (or 'A's) are needed.

     

    Another technique is to use Window Control commands. The attached macro uses the Window Control commands to get the selected item in the drop down list. No effort has been made to clean it up to make it a sample for general use. You can try to use it 'as is' or you can just look at it to see the techniques used.

    Combo_Select_Contains.zip

  15. You could use Windows' built in sort array:

     
    // Initialize file paths
    Variable Set String %InFile% to "%Temp%\InFile.tmp"
    Variable Set String %OutFile% to "%Temp%\OutFile.tmp"
    
    Join String %BigArray%[1..2000] with "," into %BigString% // Copy array to a single string. Each element is separated by a comma
    Variable Modify String: Save %BigString% to "%InFile%" // Save the string to a file
    Program Launch: "sort.exe" (Normal)
    Parameters: %InFile% /O%OutFile% // Use Windows' sort routine to sort the content of the file
    
    Variable Set String set %BigString% to the contents of %OutFile% // Read sorted string
    Split String "%BigString%" on "," into %BigArray%, starting at 1

    This uses some file I/O and consequently may not be as fast as a sort performed directly in memory. However, it may be faster than a macro with loops and a lot of macro commands.

     

    Here is my untested sample macro:

    <COMMENT/>
    <COMMENT Value="Initialize file paths"/>
    <VARIABLE SET STRING Option="\x00" Destination="%InFile%" Value="%Temp%\\InFile.tmp"/>
    <VARIABLE SET STRING Option="\x00" Destination="%OutFile%" Value="%Temp%\\OutFile.tmp"/>
    <COMMENT/>
    <JOIN STRING Source="%BigArray%" StartIndex="1" EndIndex="2000" JoinWith="," Destination="%BigString%" _COMMENT="Copy array to a single string. Each element is separated by a comma"/>
    <VARIABLE MODIFY STRING Option="\x11" Destination="%BigString%" Filename="%InFile%" CRLF="FALSE" _COMMENT="Save the string to a file"/>
    <PROGRAM LAUNCH Path="sort.exe" Mode="\x00" Parameters="%InFile% /O%OutFile%" Default_Path="TRUE" Wait="1" Get_Console="FALSE" _COMMENT="Use Windows' sort routine to sort the content of the file"/>
    <COMMENT/>
    <VARIABLE SET STRING Option="\x03" Destination="%BigString%" Filename="%OutFile%" Strip="FALSE" _COMMENT="Read sorted string"/>
    <SPLIT STRING Source="%BigString%" SplitChar="," Dest="%BigArray%" Index="1"/>

×
×
  • Create New...