Jump to content
Macro Express Forums


  • Content Count

  • Joined

  • Last visited

  • Days Won


Posts posted by Samrae

  1. There is an example of using a integer variable to index string variables in the Variable Evaluation Level article in the July 2005 issue of the Macro Express News email newsletter. That article refers to a Variable Evaluation Level sample macro.


    I think it says to use something like %T%N1%% but you may have to change the Variables Evaluation Level setting from 0 to 1 in the preferences. To get there open preferences, click Miscellaneous and then the Advanced button.

  2. Do you need the conversion within the macro? When writing macros I do the color conversion manually. I use the Mouse Locator (click Tools, Launch Mouse Locator) to view both the integer and RGB (hex) value for the cursor underneath the cursor. As Cory mentions, the Windows Calculator in Programmer's mode allows conversion between hexadecimal and integer values.


    On WIndows computers colors represented in hexadecimal format are often shown in BGR (Blue Green Red) rather than RGB (Red Green Blue). This is because Intel X86 and X86-64 processors are little-endian. The Macro Express Mouse Locator displays colors in RGB so you may need to switch the Red and Blue hexadecimal values.


    You would expect numbers in RGB format to work like this:


    E6 37 39 // more Red

    36 E7 39 // more Green

    36 37 E9 // more Blue


    But it really works like this:


    E6 37 39 // more Blue
    36 E7 39 // more Green

    36 37 E9 // more Red

  3. Your comment "date in a format that MEX doesn't support" made me curious so I studied help for the Date/Time command. There are a few predefined date/time formats but you can also type other formats in the Date/Time command. I cannot imagine a date/time format that Macro Express cannot do. Here are the two you mentioned:

    Date/Time: Save "dd"-"MMMM"-"YYYY"-"hh"-"nn" into %T1%
    Date/Time: Save "yydmm" into %T1%

    Note that "nn" is used for minutes because "mm" represents the month.

  4. Use "Repeat with Folder" to get each file name.


    If necessary use "Variable Set From File Path" to separate the file name and extension from the full path of the file.


    Use "Variable Modify String: Copy Part of %T1% to %T2%" to copy the first two characters from the file name to another variable.


    Use the "Copy File or Files: " command with something like this "\server\web\com\public\%T2%\images\folder\" for the new name.


    Like this:

    Repeat with Folder
     Variable Set From File Path
     Variable Modify String: Copy Part of %T1% to %T2%
     Copy File or Files: "%T1%"
    Repeat End

  5. The way I would tackle this is to copy of the original information to a new variable, use the "Variable Set Integer from Position of Text" command to find the needed tag, then use the "Variable Modify String: Copy Part of" command to copy or delete parts of the original source information as needed. Repeat the steps with different tags.


    Eventually you may wind up with a string that contains both letters and numbers. You can loop through that string one character at a time and copy out only the numbers.

  6. These all worked fine under windows xp.

    Windows 7 works differently than Windows XP. Just one example is the Aero interface. There can be a lot more going on between keystrokes requiring longer delays. Just because a macro worked under Windows XP doesn't mean it does not need adjustments for Windows 7.


    Have you tried increasing the delays? You can always change them back if it doesn't help.

  7. That is a sample to try to give you some ideas. T54 is supposed to hold a copy of the last order number. Upon reexamination of the same I see the confusion, this:

    Variable Modify String: Copy %T54% to %T4%

    should be this:

    Variable Modify String: Copy %T4% to %T54%

    I did not try to run this sample. it was provided to get you started.


    I edited the example above to fix the incorrect line.

  8. I need to set if the next line in the csv file is the same order number as the one I am currently processing. If it is then I need to add another item. If it is not, then continue and create a new record.

    The sample provided above does that. Look at the comments "// Order number matches previous" and "// Order number is unique".

    I suggest you start with something and see how it works and then adjust it.

  9. From your decscription it sounds like you are processing through using Excel or some other program. You may find it easier and more reliable to process the csv file within Macro Express itself. The ASCII Text Begin Process command repeats all the steps between the Begin and End commands for each line in your csv file. Each time it repeats it will put the order number in T4 from the new line in the .csv file. To compare with the previous order number you need to save the current order number into a variable that will not change. If your loop is using T1 through T6 then you could save the previous order number in T10 through T99.


    There is a description in the help that describes the ASCII Text Begin/End Process commands. Open help, click the Search tab, type ASCII Text File and click the List Topics button.

  10. Something like this might get you started.

    ASCII File Begin Process: "test.csv" (Comma Delimited Text )
     If Variable %T54% = "%T4%"
    // Order number matches previous
    // Order number is unique
     End If
     Variable Modify String: Copy %T4% to %T54%  // copy order number to T54
    ASCII File End Process

  • Create New...