Jump to content
Macro Express Forums

kevin

Admin
  • Posts

    1,950
  • Joined

  • Last visited

  • Days Won

    3

Posts posted by kevin

  1. Is this a bug in the Macro Express software or have I set up the variable syntax wrong.

    You could use the debugger to step through your macro from within the Script Editor. Click Debug, Show Variable values to display the variables as you step through the macro. Or you can insert a Text Box Display command with "C:\McL\Admin\Scans\%T[1]%.pdf" in it to display the path.

     

    what is the difference between T1 and T[1] I have used both interchangeably but this may be a problem.

    T1 and T[1] are not the same variable. You can use either but do not expect them to contain the same thing. T1 is a variable containing a string. %T[1]% is part of an array variable. You access individual elements of the array with an index like %T[2]% or %T[%Idx%]%. Note that %Idx% is an integer variable in this case.

     

    Instead of using T1 as a variable name you should consider using a name that reflects the purpose of that variable. You might use %NewFilepath%, for example.

  2. I confirmed this. It is interesting behavior. On Windows 7 the position of a maximized window is reported as -8, -8. This is because the borders around windows in Windows 7 are wider than Windows XP. I too am surprised that I have never heard of or noticed this behavior but it makes some sense.

     

    Macro Express gets the size and position of windows from Windows. It reports exactly what Windows reports.

  3. Macro Express Pro v 4.2.2.1

     

    Macro Express Pro v 4.2.2.1 is now available. This version includes these changes:

    • Fixed a problem where in some cases the name of a variable was copied instead of the content of the variable,
    • Added the ability to edit a macro even if it's locked by another user.
    • The errors in the 'Catch Error' dialog are now sorted alphabetically.
    • When the macro error dialog is displayed, the user can now press Ctrl+C to copy the contents of the window to the clipboard.
    • Fixed a bug in the 'Variable Modify String: Copy part of string' command where the source variable was not processed.
    • The 'Variable Set From File path' command now returns the correct filename when the file extension is included twice in the filepath.
    • The 'Encrypted Text' command now supports the 'Keystroke Speed' settings properly.

     

    For a complete list of changes, see the Macro Express Pro v 4.2.2.1 Release Notes. Download Macro Express Pro from the Macro Express download page.

     

    For more information, including tips and sample macros, we invite you to read the January 14, 2011 issue of the Macro Express News.

  4. Paul and Arek, my apologies. What was I thinking? You are correct, there is a rounding error with negative numbers. I was getting confused with how Macro Express rounds numbers that end in 5 (1.5, 1.05, 1.005, etc.).

     

    After taking a few days to look at this issue further, I finally realized what is going on. We are working on a fix. In the meantime, enabling Bankers Rounding will fix the issue with rounding -9.600001. It will, however, round numbers that end in 5 differently.

     

    To enable Bankers Rounding create this Windows Registry setting:

    HKLM\Software\Insight Software Solutions\Macro Express 4\AdvOptions\Bankers Rounding

    and give it a DWORD value of 1.

  5. I do not have time right now to create a sample macro but you could try something like this:

     

    - Use a 'Repeat with folder' loop to get the name of each folder.

    - Create a loop to process through each character of the folder name copying only the valid ASCII letters to another variable.

    - Use the If Variable command to see if the variable containing the original name and the new name are different.

    - If different, use those variables in the Rename File or Folder command to rename the folder.

  6. Copy the variable to a temp var. Get the length of the var. Get the length of the search string. Variable Modify String Replace Substring on the temp and include the option for all instances. Now get the length again. Subtract this length from the beginning length and divide by the search string length. Voila!

    Cool hack Cory. You posted this while I was composing my (longer) solution.

  7. There is no direct way that I am aware of. This sample macro will do it.

     
    
    //   Initialization
    Variable Set String %SearchFor% to "Hello" // Enter the string to search for
    Variable Set Bool %Done% to "False" // Initialize Done flag
    Variable Modify String %sTemp%: Copy Whole Text (%Text%) // Make a copy of your original string
    Variable Set Integer %Count% to 0
    
    // Count the instances of %SearchFor% in %sTemp%
    Repeat Until %Done% Equals "True"
     Variable Modify String: Replace "Hello" in %sTemp% with "" // Do not check the 'Replace All Instances' box
     Variable Modify Integer %Count%: Increment
    
     // See if we're done
     If Variable %sTemp% Contains "Hello"
       Variable Set Bool %Done% to "True"
     End If
    End Repeat
    

    I am curious if someone else has an easier/shorter/faster way.

  8. Macro Express Pro supports macros in multiple files. The macro and file handling is more complicated than that of Macro Express 3 and thus, it may take longer to process Macro Enable and Macro Disable commands.

     

    We recently made some changes to the routines that handle enabling and disabling macros. In our testing based on your description of the problem, the changes we made improved enabling and disabling macros.

     

    We have made two suggestions:

     

    1. Put a small delay between each Macro Enable or Macro Disable command.

     

    2. Put your macros in separate files. You can load and unload separate macro files containing macros using the Load New Macro File and

    Close Macro File commands.

     

    If you need further help with this issue then contact our Support people. Be prepared to give them your license number or other proof of purchase.

  9. Macro Express Pro uses a common dialog box to allow you to navigate to a file or folder. Windows remembers the last folder you navigated to via the Browse button. Click File, New File or File, Open File and click the Browse button. Navigate where your macro files are located. The next time you do these steps the default file will be the last folder accessed. However, it will be set to another value if you later navigate to a different folder.

  10. Try putting a 2 second delay between the attempt to open each new site in Internet Explorer. When spending time evaluating and modifying the Define Word Take 5 I discovered that the amount of delay needed to make the macro reliable varied dramatically between browsers. On my computers Firefox needed 0.01 second delay, Opera 1, Safari 0.75, Chrome 0.01 but IE 2.0 needed 2.0 seconds.

     

    This behavior is a result of how each browser works. It is not related to Macro Express itself.

     

    The Define Word Take 5 macro determines which browser is in use and adjusts the delays accordingly. Feel free to download and modify it for your needs.

  11. I'd be very interested to see any authority where rounding -9.600001 could ever produce -9.5!

    As I said, Delphi and other development environments round up. Java rounds up.

     

    In Excel "Fix() rounds towards 0 (up in the absolute sense, but down in terms of absolute magnitude). Fix(-3.5) is -3.5." But "Int() rounds away from 0 (up in terms of absolute magnitude, but down in the absolute sense). Int(-3.5) is -4."

     

    Open office's calc rounds up.

    Spend some time with an Internet search and you will see all kinds of differing opinions. At any rate, Macro Express rounds negative numbers up.

  12. Alan's suggestion is good but stops the repeat loop. If you want to skip macro commands for certain conditions but continue with the repeat loop you can do something like this:

    Repeat with Variable: Repeat %N1% times
     If Variable %N99% Not Equal "0" // (any condition you choose)
       <do other macro commands here>
     End If
    End Repeat
    

    As Paul mentioned, Macro Express Pro has a Continue command to make this easier.

  13. MEP produces -9.5 when asked to round -9.60000000000001 to a single decimal point. This answer is simply wrong - the correct response is -9.6.

    You should report this as a bug.

    While we might think that the method of rounding a number is a simple decision there are actually many definitions of how to round a number (as illustrated by spending some time searching the Internet). Macro Express supports two rounding methods, Asymetric Arithmetic Rounding and Bankers Rounding. By default, Asymetric Arithmetic rounding is used. You may set Macro Express to use Bankers Rounding with a Registry entry.

     

    In either case, Macro Express always rounds up. That is, it rounds to a higher number. In the case of -9.600001, the value -9.5 is the next higher number. Rounding to -9.6 would be rounding to a smaller number.

     

    There are different methods of rounding and different opinions about which is the 'correct' one. An argument could be made for rounding to the next higher absolute value but the decision was made to always round up. This decision was actually made for us. Macro Express is written in the Delphi development environment. This is the way that Delphi (and other development environments) round by default.

     

    You can use macro commands to alter the rounding method. These commands round to the next higher absolute value:

    // Perform absolute rounding
    If Variable %Dec% Is Less Than "0"
     Extended Math%Dec%=Abs(%Dec%)
     Variable Modify Decimal: Round %Dec% to 4 decimal places
     Variable Modify Decimal: %Dec% = %Dec% * -1
    Else
     Variable Modify Decimal: Round %Dec% to 5 decimal places
    End If

  14. When a macro is running, Macro Express sends keystrokes and mouse events to Windows and Windows sends them to the application that has focus. When Windows is locked, if you minimize a remote session or if you disconnect a remote session, Windows stops sending the keystrokes and mouse events to the application. The macro continues to run but Windows discards the keystrokes and mouse events.

     

    There is a work-around. If you can use Window Controls to send text and mouse clicks, the macro will continue to run when the workstation is locked.

  15. Welcome back Steve!

     

    As you have noted, all of the tasks you have outlined can be automated by Macro Express. For other ideas, have you read through the case studies on the How Customers Use Macro Express page? (Be sure to click through to the details). These contain real-world examples of how Macro Express has saved other companies and organizations time and money.

     

    The Customer Comments page also contains descriptions of how much Macro Express saves organizations. This is one example:

     

    "We save over 1,100 hours a month using Macro Express. Our company uses Macro Express extensively. One macro alone is used 33,000 times per month. Each time this macro is used, it saves our customer service representative 2 minutes." --Name and company withheld upon request
    Send me a personal email or call me if you would like a few more details about this example.
×
×
  • Create New...