Jump to content
Macro Express Forums

wbeldman

Members
  • Posts

    24
  • Joined

  • Last visited

Posts posted by wbeldman

  1. I've never used this in production and certainly not in Firefox, but it's probably worth the experiment...

     

    Ctrl+F Find dialog

    unique label text The text before the input-tag (doesn't matter whether its in a real label-tag or just some designating text before the input)

    Enter Find it, select (highlight) it

    Esc Close the Find dialog

    TAB To the input field

     

     

    Make shure the label can be found or handle the not found popup!

  2. You say you are typing %t2% into the text type.  You can't just type it, you must use the drop down for the VARIABLES at the bottom part of the text type window, choose the variable you want and then click on the INSERT button right next to it. 

     

    Try that if you were just typing it in.

    Note that you can type %T2% directly but you must use upper case T... This should increase johnboy691's development process :D

  3. I'm not completely shure what yout mean, but selecting can be done in several ways. Going through multiple fields you might consider using TAB. Depending on the type of field the value probably is selected then.

     

    You can of course focus the text field by a mouse click and then do

    Text Type: <HOME><SHIFT><END>

     

     

    Is this a clue you're looking for?

  4. In the Macro Explorer (the editor) the Commands pane has a category Mouse. Double click the Mouse Left Button command (or middle or right) and a popup appears giving you variants as double clicking.

     

    Highlighting can be done with the left button but afaik you'll need the right button to copy (via the context menu). You can do Text Type: c

     

    Alternatives to copy and paste are of course the shortkeys

    Ctrl+C

    Ctrl+V

    Shift+F10 for context menu

  5. how do i grab a URL from a website text

     

    In Internet Explorer: use Alt+d (not shure about other browsers, but I assume they have a similar shortkey as well). Now the URL is selected, so you can copy it.

     

     

     

    then grab a specific number from that

    I'm not at the office with a real Macro Express so beware of typos.

    Make a copy of the string variable containing the URL (here T90).

    Find out where this page argument begins: find the position of ?page= in the URL.

    Variable Set Integer %N90% from Position of Text in Variable %T90%

    N90 + 6 is the first digit of the number you're looking for.

    Get rid of everything before that point (that's why you should make a copy first). Copy from T90 to T90 beginning at the N90th character until the end of the string (the 99999th character).

    Variable Modify String: Copy Part of %T90% to %T90%

     

    Now you have to look for the first nonnumeric charcter (or the end of the string).

    Repeat Count 99999, Start 1, Step 1, Place Counter in Variable N91

    Repeat Start (Repeat 99999 times)

    Copy from T90 to T91 1 character from Starting Position N91

      Variable Modify String: Copy Part of %T90% to %T91%

    Loop until T91 contains another character, then break

      If Variable %T91% < "0"
       OR
     If Variable %T91% > "9"
       Break
     End If
    Repeat End

     

    N91 now holds the length of the number.

    Copy from T90 to T90 N91 characters from Starting Position 1

    Variable Modify String: Copy Part of %T90% to %T90%

  6. I hope you realise you have to process the list of files from the highest number back to one? Suppose these files exist

    01.jpg

    02.jpg

    03.jpg

    04.jpg

    Now renameing 01.jpg to 02.jpg conflicts with the existing file 02.jpg etc.

    So rename 04->05, 03->04, 02->03, 01->02.

     

     

    Sorting: click on the column header in your Explorer window (maybe using Get Control).

     

    If sorting is the problem, try the built in Rename File or Files command. With a Repeat use the counter variable to rename the file directly.

  7. I asume you want to do the following:

    If "ACH Unathorized CCDs.csv" exists then do 3 copy actions.
    
    If "Five Star Credits.pdf"  exists then do 3 copy actions.

    These two lines are not related to each other, but you placed an Else in between. Your code states:

    If "ACH Unathorized CCDs.csv" exists then do 3 copy actions
    Else (if "ACH Unathorized CCDs.csv" doesn't exist) and If "Five Star Credits.pdf" exists then 3 copy actions.

    Make separate code blocks for each file starting with If File Exists.

     

     

    Note that every Else is optional (see the bottem of your example).

  8. Do you mean something like this?

    If File Exists: "aaa11111.pdf"
      Rename File or Files:"aaa11111.pdf"
      Move File or Files "bbb11111.pdf"
    End If
    
    If File Exists: "QQtoday"
      Rename File or Files:"QQtoday"
      Move File or Files "QQ20070608"
    End If
    
    If File Exists: "x.csv"
      Rename File or Files:"x.csv"
      Move File or Files "Gross Sales.xls"
    End If

    In Macro Explorer: category Files/Folders (and category Logic for If and End If)

  9. FYI:

     

    Now ME can't natively do date comparisons

    Sort of... in date format YYYYMMDD you can do an ASCII comparison. The ASCII value (character number) of 3 is smaller than the ASCII value of 4...

     

    Date: Save YYYYMMDD (20000319) into %T90%
    If Variable %T90% > variable %T95%

    You'd better use the Text - Date command to get the proper format.

     

     

    Note that you can also compare timestamps (date & time) but remember that a date with time addition is always larger than one without.

    Date: Save YYYYMMDD (20000319) into %T90%
    Time: Save hhmm (1544) into %T91%
    Variable Modify String: Append %T91% to %T90%
    If Variable %T90% > variable %T95%

  10. Quoting Joseph Weinpert: Macro Express Explained:

    Alt Key

    Control Key

    Shift Key

    Win Key

    These commands allow you to control the down or up state of these "control" keys. For every "down", there must be a matching "up", in other words, they work in pairs. This is so important that Macro Express displays each command line between the down and up state indented, like in a Repeat Loop or If / End If structure.

    Activate Window: "Microsoft Word" // Activate Word
    Shift Key Down // Hold the Shift Key down
      Repeat Start (Repeat 20 times) // Loop 20 times
         Text Type: <ARROW DOWN> // Select next line
      Repeat End // Done repeating
    Shift Key Up // Let go the Shift Key

     

     

    Try two Macro Run commands within the Ctrl Up en Down:

    Control Key Down
      Macro Run: MacroThatStartsWithControlJ
      Macro Run: MacroThatStartsWithControlK
    Control Key Up

  11. Neither did I miss GoTo and there might be a better way to code your problem. But answering your questing, try something like

     

    Repeat 1 times
     Action01
     If Condition = Right
       Break
     End If
    
     Action02
     If Condition = Right
       Break
     End If
    
     Action03
     If Condition = Right
       Break
     End If
    End Repeat
    
    FinalAction

     

     

     

    Note that I coded this without ME so please pay no attention to the syntax :)

  12. Consider something like this:

     

    Repeat Start (Repeat 30 times)

      // or your own (currently working) error window detection mechanism

      Variable Set String %T90% from Window Title

      If Variable %T90% = "Error"

        // you might try to press Enter rather than click OK

        Text Type: <ENTER>

        // break out of the repeat loop

        Break

      End If

      Delay 0,1 Seconds

    Repeat End

     

    The disadvantage is the obligation to wait a while (3 seconds) whether the Error popup appears...

  13. I'll try to comment it. Note that you cannot copy this into Macro Express directly!

     

     

    //Previously one line from the Notepad document was copied to the Clipboard.

    //Don't use Ctrl+Shift+arrow but: Home Shift+End

     

    //Store this line in temorary text variable T4

    Variable Set String %T4% from Clipboard

    //Get rid of leading and trailing spaces/tabs

    Variable Modify String: Trim %T4%

     

     

     

    // Get First Name

    //Set temporary variable N4 to the position of the first space in T4.

    //Double click the command in the Scripting Editor and click in 'Search Text' to see the space.

    Variable Set Integer %N4% from Position of Text in Variable %T4%

     

    //Decrease N4 (subtract 1) so that N4 is the position of the last character of First Name

    //and also the length of First Name.

    Variable Modify Integer: Dec (%N4%)

     

    //In case no spaces were found, N4 is 0

    If Variable %N4% < 0

    Text Box Display: Error:

    Macro Stop

    End If

     

    //Copy First Name to T1

    //Copy N4 characters from T4 to T1 starting character 1.

    Variable Modify String: Copy Part of %T4% to %T1%

     

    //Delete First Name from T4

    //Delete N4 characters from T4 starting character 1.

    Variable Modify String: Delete Part of %T4%

     

    //Get rid of leading and trailing spaces/tabs in First Name

    Variable Modify String: Trim %T1%

    //and display it

    Text Box Display: First Name:

     

     

     

    // Get Last Name

    //Reuse temporary variable N4 and set it to the length of the remaining: maybe Middle Name(s) & Last Name

    //which is also the position of the last character.

    Variable Set Integer %N4% from Length of Variable %T4%

     

    //Copy N4 to other temporary variable N3. We have to modify this value below and we also need N4 again.

    //You could also use Variable Modify Integer: Copy %N4% to %N3%

    Variable Set Integer %N3% to %N4%

     

    //Repeat: look througth T4 (from last to first character one by one) until a space was found.

    Repeat Until %T3% Contains " "

    //N3 initially points to the last character of T4. At each repeat loop:

    //Decrease N3 (subtract 1) so that it points to the previous character

    Variable Modify Integer: Dec (%N3%)

     

    //Copy the characters from position N3 to the end

    //Copy N4 characters from T4 to T3 starting character N3

    Variable Modify String: Copy Part of %T4% to %T3%

    Repeat End

     

    //When a space was found, the Repeat was aborted.

    //This can be the space between Middle Name & Last Name or the space between First Name & Last Name.

    //T3 now contains the Last Name.

     

    //Delete Last Name from T4

    //Delete N4 characters from T4 starting character N3

    Variable Modify String: Delete Part of %T4%

     

    //Get rid of leading and trailing spaces/tabs in Last Name

    Variable Modify String: Trim %T3%

    //and display it

    Text Box Display: Last Name:

     

     

     

    // Get Middle Name

    //Copy everything that is left in T4 to Middle Name. If no Middle Name is present, T4 contains only

    //the space between First Name & Last Name.

    //You could also use Variable Modify String: Copy %T4% to %T2%

    Variable Set String %T2% "%T4%"

     

    //Get rid of leading and trailing spaces/tabs in Last Name

    Variable Modify String: Trim %T2%

    //and display it

    Text Box Display: Middle Name:

     

     

     

     

     

     

     

    //names with - between has to be one name.

    //In my case they sometimes look like this george-schmidt.

    //george-schmidt is one name.

     

    As we only consider space as a separator character, that's no problem.

  14. Now on import both the old, existing macro and the newly imported one are listed in the Macro Explorer list:

     

    MyTestMacro        No Activation  Global  02-02-07 15:21

    MyTestMacro        No Activation  Global  02-02-07 15:31

     

     

     

    Can we be sure that all Macro Run commands reference to the oldest macro?

     

    And that by deleting that macro all references point to to the newer copy automatically (then the only copy)?

     

     

    In that case we have a safe two step Import & Replace procedure...

  15. Mouse Move Window 390, 99

    Mouse Left Button Click

    Clipboard Empty

    Wait Time Delay 3 Seconds

    Mouse Move Window 630, 97

    Mouse Left Button Double Click

     

    Should there be some copy command here? Like:

    Clipboard Copy

     

    or:

    // Context menu -- Copy

    Mouse Right Button Click

    Text Type: c

     

    Variable Set String %T99% from Clipboard

    Replace " " with "" in %T99%

    Activate Window: "Excel -"

    Delay 5 Milliseconds

    Mouse Move Window 235, 486

    Mouse Left Button Click

    Text Type: %T99%

    Delay 5 Milliseconds

    Mouse Move Window 389, 484

    Mouse Left Button Click

    Text Type:

  16. The explanation above is very helpful but I'd change one bit of this scenario...

     

    Instead of modifying a macro in the .mex file which is in use on several production systems, I'd rather have a separate prod.mex and a dev.mex (and maybe a test.mex as well). The production PCs use prod.mex and all my modifications are made in dev.mex.

     

    To put an update into production, I would like to open prod.mex and import the update. But that causes two macros with duplicate names to show in the MacEdit's macro list! At least that's happening now, before we bring this locking into practice...

     

    Is it possible to turn this option off, prevent it in any way from working or do you have another solution??

     

    TIA

  17. It's worth the question I think:

    IF T20 = SDN is not an option?

    In that case you can use the Switch command.

     

     

     

    If in your situation *contains* is appropriate, try the following:

     

    N90=0

     

    IF T20 contains SDN

    Variable set T21: A

    Variable set T22: B

    Variable set N90: 1

    End if

     

     

    [20 times...]

     

     

    //general Else statement

    IF N90=0

    //none of the above tests was true

    Variable set T21: 1

    Variable set T22: 2

    End if

  18. If the city name is preceded by a space character:

     

    //for testing

    Variable Set String %T1% "20120 Malmö "

     

     

    // Get position of space character in T1

    Variable Set Integer %N1% from Position of Text in Variable %T1%

    // Get position of character after the space

    Variable Modify Integer: Inc (%N1%)

    // Copy from T1 to T1: Starting Position: Variable N1, Characters to Copy 100000

    // that will also work for shorter variables

    Variable Modify String: Copy Part of %T1% to %T1%

     

     

    //for testing

    Text Box Display: %T1%

×
×
  • Create New...