Jump to content
Macro Express Forums

Whats Wrong With The If In The Attach Macro?


koden
 Share

Recommended Posts

When the first IF is true

(if T9 contains T5 and T6)

 

it shut down the window OPC and the window request, BUT ends with an error.

 

The window OPC is not active.....and macro stops..

 

have i forgotten something??

 

OR,ELSE,ENDIF ???

 

I'm going to use the macro tomorrow, so If anyone have the time, I would be pleased

test1.mxe

Link to comment
Share on other sites

I'm not sure, but I can try tomorrow morning..

 

I just know that it delete the mail and shut down the request as it has to do in the first IF statement.

 

After there the error comes, that tells it can't activate OPC.

(OPC is the mail that it has shut down in the first IF statement).

 

But anyway...I can see it's dificult to help with this inf.

I will get some more inf. :-))

Link to comment
Share on other sites

I have tested now...

 

This happens:

 

The first IF statement is true

(save all job...txt contains the same as T5 and T6)

 

The macro close the OPC mail and the request (as the IF statement tells it to do).

 

Then I can see the macro does the paste T5 and T6 into save all job...txt.

And just after this it says:

 

The specified window OPC could not be found on your computer. The macro will be aborted.

 

This is what should have been happend:

 

After the first IF statement have been done (because it was true), the macro should jump to the last ENDIF in this macro.

Link to comment
Share on other sites

The End If statement on line 55 needs to be removed.

If Variable %T8% does not contain "Tryg"
 Delay 1000 Milliseconds
 Activate Window: "OPC"
 Delay 500 Milliseconds
 Wait For Window Title: "OPC "
 Delay 500 Milliseconds
 Text Type: <CONTROL>w
 Delay 500 Milliseconds
 Text Type: <ALT>n
 Delay 500 Milliseconds
 Text Type: <ARROW DOWN>
 Delay 1000 Milliseconds
 Activate Window: "Request E50"
 Delay 500 Milliseconds
 Wait For Window Title: "Request E50"
 Text Type: <ALT>c
 Delay 1000 Milliseconds
End If
Else

Your code should look like this:

If Variable %T8% does not contain "Tryg"
 Delay 1000 Milliseconds
 Activate Window: "OPC"
 Delay 500 Milliseconds
 Wait For Window Title: "OPC "
 Delay 500 Milliseconds
 Text Type: <CONTROL>w
 Delay 500 Milliseconds
 Text Type: <ALT>n
 Delay 500 Milliseconds
 Text Type: <ARROW DOWN>
 Delay 1000 Milliseconds
 Activate Window: "Request E50"
 Delay 500 Milliseconds
 Wait For Window Title: "Request E50"
 Text Type: <ALT>c
 Delay 1000 Milliseconds
Else

The End If command terminates the IF statements which will cause your ELSE statement to be executed regardless of IF statements.

Link to comment
Share on other sites

Ohh.. I think you look at the first attached macro. I have attached a new one.

Sorry...I schould have wrote that.

 

The first one was called test.

The new one test1.

 

But it was the same problem, so This works now...ENDIF in line 21 has to be deleted

 

BUT

 

then I got a new problem :-)

 

Now when endif line 21 is gone line 21 is if variable T8 does not contain Tryg

 

This IF statement doesnt work if T8 contains f.ex. "5 test af ikke"

 

So the first IF statement with T5,T6 and T9 is not true.

That works.

 

But when the second statement is true: if variable T8 does not contain Tryg

Then it seems to jump out of this macro and go on with the next macro.

 

Do I have a problem with my endif??? :-)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...