Jump to content
Macro Express Forums

koden

Members
  • Posts

    248
  • Joined

  • Last visited

Posts posted by koden

  1. I have a macro that sometimes stops.

    Normally because a window does not appear or something else.

    proberly a problem in windows or one of the programs that the macro works with.

     

    But how do I get the macro to always to restart, when one of this "stops" happens?

     

    I know that I can use IF all the places where it needs. But thats a lot of IF commands.

     

    Is there a better way to tell the macro ALWAYS to restart itself, when this "window did not appear" errors comes??

     

    Some kind of an IF command that always will be true, when thís error screens comes up, no mather where in the macro.

  2. I have attached my macro.

     

    First time I run this macro it goes wrong in line 49/50

    move to 37,711 is ok and I can see it makes the line 50 mouse left click

     

    But the 9 tabs repeat does not start from this point.

     

    It's seems that the program does not reg. that the mouse have moved to 37,711.

     

    I cancel the macro and runs it again, maybe 10 times and then there is no problem.

     

    Is it the macro or my program??

    test.mxe

  3. My macro opens a window.

    sometime this window does not appear, because the window does not exist.

    Then a stop macro command runs in a IF window not appers command.

     

    But sometimes the window is slow and the stop macro appears before, even if the window exist, but just is slow.

    I have tried with 2 sec relay, but it stills errors.

     

    If I use the wait for window command, there is a problem when the window does not exist.

    then it will error on that the window not exist, instead of stop the macro.

     

    Do anyone understand or is it to ???? :-)

  4. Thanks for the code and explanation.

     

    I have one more word EMAIL that has to be handelt.

     

    flyttet, oprettet and email has to be handelt in 3 different ways, just for your inf.

     

     

    is this the right way with an OR command:

     

    If Variable %T1% contains "flyttet"

    // ...

    Process mail like process 1

    OR

    If Variable %T1% contains "email"

    Process mail like process 2

    // ...

    Else

    If Variable %T1% contains "oprettet"

    AND

    If Variable %T1% does not contain "nordea"

    // ...

    // Process mail

    // ...

    Else

    // ...

    // Delete mail

    // ...

    End If

    End If

     

     

     

    But what is this:

     

    <IFVAR2:1:01:7:Tflyttet><REM2:...><REM2:Process mail><REM2:...><ELSE><IFVAR2:1:01:7:Toprettet><AND><IFVAR2:1:01:8:Tnordea><REM2:...><REM2:Process mail><REM2:...><ELSE><REM2:...><REM2:Delete mail><REM2:...><ENDIF><ENDIF>

  5. Okay.. so this is okay:

     

    If T1 contains

    Nordea

    OR

    USD sag

    OR

    slettet

    Then delete mail

    end if

     

    This will delete mails where one of the word appears.

     

    But if none of the words appears and the word "oprettet" appears i T1

    then it will go on to the next if statement:

     

    If T1 contains

    oprettet

    then "do something with mail" (another macro).

    end if

     

    If none of the 4 words appears in T1 it will go on to the next if statement (if there is anyone) or it will stop??????????????

  6. I copy the subject field from a lot of mails into T1

    Then i test the content.

     

    But what is best to use? case,switch or if....

     

    If the word "Nordea" or "USD sag" or "slettet" appears in T1 the mail has to be deleted.

     

    If the word "oprettet" appears in T1 the macro schould take action on the mail.

     

    If the word "flyttet" appears in T1 the macro schould take action on the mail.

     

    Sometimes "oprettet" and "nordea" appears in T1 together. If that, the mail has to be deleted.

     

     

    ------------------------------------------------------------

     

    at the moment i use

    If T1 contains

    Nordea

    OR

    USD sag

    OR

    slettet

    Then delete mail

    end if

    If T1 contains

    Oprettet

    and

    nordea

    Then delete mail

    end if

    If T1 contains

    oprettet

    then "do something with mail"

    end if

     

     

    But do I need this?:

     

    If T1 contains

    Oprettet

    and

    nordea

    Then delete mail

    end if

     

    when I have had this in the start:

     

    If T1 contains

    Nordea

    OR

    USD sag

    OR

    slettet

    Then delete mail

    end if

  7. I have to copy a field that can be 6 or 7 digits/letters

    The progam I copy from is a mainframe system.

     

    Therefore I do it this way:

     

    I go to the start of the field and copy the first 6 marks into T2.

    (T2 will always contain 6 numbers or letters).

    Then I go back to start of field and copy 7 digits into T3.

    (T3 will sometimes contain 7 numbers/letters and other times 6 and a space).

     

    later in my macro I have to paste T2 or T3 out in another program.

     

    But how do I made the right IF statement??

     

    There is one where I can compare value or variable.

    But how do I tell the "IF" that if T3 contains 7 marks than paste T3 and if T3 contains 6 marks and a blank, then paste T2.

     

    Explanation:

     

    The mainframe system is stupid....

    So I have to go to the start of the field and hold shift and press arrow right 6 or seven times. Then i make ctrl+c.

    If the 7 mark is blank, and I then paste it out in my other program, the other program sees it as a mark.

    So therefore I have made this T2 and T3 solution :-))

  8. Cyberchief have now explained so I can understand it :-)

    Thanks to booth of you....

     

     

    // Set T10 to "comma space"

    Variable Set String %T10% ", "

    // Copy your first text and set to T1

    Clipboard Copy

    Variable Set String %T1% from Clipboard

    // Append T10 to T1 to be "Text, "

    Variable Modify String: Append %T10% to %T1%

    // Copy next set of text

    Clipboard Copy

    Variable Set String %T2% from Clipboard

    // Append new text to T1 (will now appear as "Text, NewText"

    Variable Modify String: Append %T2% to %T1%

    Variable Modify String: Append %T10% to %T1%

    // Repeat Append T10 to T1, Clipboard copy, save to T2, Append to T1 as many times as needed.

  9. I have to copy 3 things into a T variable and put a comma between.

    But how do i copy more than 1 parameter into a T variable?

     

    Lets say i copy first name and put it to T1.

    Thats easy

     

    But then i copy tlf. number and want to put this in T1 after the name and seperatet with a comma.

     

    At the moment I first copy name and number to a txt document and then into T1.

  10. Thanks again...

     

    Step 2 is my problem. the rest i think I have understand.

     

    Specially how i copy the job,code and date into same variable (you wrote: Get a mail, and place into T2, job code and date separatet by comma).

     

    If i copy job into T2 and after this code into T2, then job will be gone???

    Or is it first to be set into C:\Mypath\UniqueCombinations.txt and then copy to T2 ?

     

    proberly I'm on a lover level than you think :-))

     

    Ps. What I mean with notepad ??? proberly the same as you with the C:\Mypath\UniqueCombinations.txt.

    "A comparing document" ???

     

    I will try to explain how I understand it now:

     

    START:

    copy content of UniqueCombinations.txt to T1

    open mail

    copy >job,code,date/< into T2 (this I can't understand how to do).

    Check if T1 contains T2 (if: delete mail. If not: proceed)

    Append T2 to T1 (if T1 did not contain T2 else append nothing)

    After have running ex. 10 mails, then append T1 to UniqueCombinations.txt and save it.

    END:

     

    Go back to start and run when next mails arrive.

     

    You have helped a lot. Thanks...

    I will make a new question about how to fill up T2 with more than one copy.

  11. I have looked at it. maybe I don't understand it fully.

    Here is how I understand:

     

     

     

    I use text type to get it to my notepad (the empty notepad starts with / ):

     

    copy job1 into T5

    copy code1 into T6

    copy date1 into T10

     

     

    text type: %T5%,%T6%,%T10%/

     

    This will give a notepad that lokks like this:

     

    /job1,code1,date1/

     

    After some mails without same contains it will look like ex. this:

     

    /job1,code1,date1/Job1,Code1,Date2/Job2,Code1,Date1/

     

    At each mail I start with copy the content of notepad into T9

    Then I:

    copy job1 into T5

    copy code1 into T6

    copy date1 into T10

     

    make an IF statement that says:

     

    IF variable T9 contains variable T5

    AND

    IF variable T9 contains variable T6

    AND

    IF variable T9 contains variable T10

     

    Delete mail.

     

     

    BUT as I write this, I can see the problem :-))

    I can't do this. I have to copy T5,T6 and T10 into a new variable like T12 and compare T9 with T12.

     

    When I copy into T12 I have to make the / and comma

     

     

    But I'm not sure how to copy into T12 and put / and , on

     

    As you write I can copy job,code and date directly into T12....But how...??

     

    I get clever and clever as more I write :-))

     

    This is proberly what you mean:

     

    copy job to T12 and then copy code to T12 and then copy date to T12

    (i just don't know about / and ,).

    compare T9 (from notepad) with T12

    Same same...delete mail else paste T12 to notepad.

     

     

     

    Soething that wonders me is how the macro can compare only between / and /.

    And why do I need comma ??

  12. Thanks...

     

    There is a little problem I think.

    If i copy this to my T variable, it has to remember it the hole day, så taht it can compare data from each mail.

     

    But will the T variable not be empty when the macro has finished??

     

    I run the macro many times a day.

     

    So maybe I still should use my notepad document and delimited with / at the end ?

    Like this:

     

    Notepad:

     

    /Job1,Code1,Date1/

    Job1,Code1,Date2/

    Job2,Code1,Date1/

     

    Does it have to be in one line or can i make new line between, as shown over here.

  13. I have a field where I paste the content of T15.

    T15 is a lot of text, and sometimes it takes time to paste it, and sometimes not (speed problem in this program i use).

     

    After pasting the macro runs ALT+T to open menu in top of program and then L to choose from menu. But sometimes it just write TL after the T15 paste, and the macro stops because the new window does not open.

     

    But is there a wait command that says:

     

    "Wait until T15 is finished with pasting and then go on with ALT+T" ??

×
×
  • Create New...