Jump to content
Macro Express Forums

Macro Stalls - Clearer Instructions?


renee

Recommended Posts

I've created a macro that is 266 lines long.

 

The macro is exactly the same except that it chooses different items from a drop down menu. Basically it opens a reports menu, goes to the particular report and prints it. If it is not available it the program throws up a dialogue box that says "report not available". I have a macro that is an if statement that makes it proceed to the next report if it gets this message. It will run fine 26 times then stalls... or acts like it has found a report and then makes the mouse moves to print it. This happens after a document is not found. There are reports not found all thru the macro.

 

It only happens when it gets to the end. I took where it was stalling and created a new macro with just those lines of script. Again, it starts running fine. Continues thru a "not found report" and goes correctly then suddenly it stalls again.

 

If I write a macro exactly the same and run that macro over and over again, how can this be happening?

 

Any help would be greatly appreciated. Its making me nuts! - Renee

Link to comment
Share on other sites

It's probably some limitation in your "report not available" code. Since you did not post any of the code, it is hard for us to diagnose. But I'm guessing it is a timing issue, or you did not account for stray dialog boxes which occasionally appear.

 

I'm also guessing you're not around when the bug happens, which makes it hard to debug.

 

If you're unable to hang around to debug, you could try making a screencapt just before the suspect code in your macro. This way, you can check if the correct program has focus, if there is a stray dialog box, etc.

 

Here is some generic code for a screencapt with timestamp:

 

Date/Time: Save "hh-mm-ss" into %T1%
Text Type: <PRTSCR>
Delay 30 Milliseconds
Clipboard Save Graphic: "Debug %T1%.jpg"
Delay 30 Milliseconds

Link to comment
Share on other sites

Thank you so much for answering.

 

I have sat and watched it carefully. I'm not sure I said this but it looks like it pulls the menu down, because I see a flash, then it pauses and the mouse begins to move like it has opened a report.

 

Here is the code, maybe this will hope.

 

Also, where would I put the code you so kindly gave me? That is if it's not obvious what I'm doing wrong. Thanks again for your help!

 

Here is where I think it's getting hung-up:

 

Delay 2 Seconds

Text Type: <ENTER>

// Selects Last Episode

Wait For Window Title: "Episode"

Delay 1 Seconds

Text Type: <ENTER>

Delay 5 Seconds

Wait Window Lose Focus: "Processing"

Delay 1 Seconds

If Window Title "ERROR" is on top

Variable Set Integer %N1% to 0

Text Type: <ENTER>

Delay 2 Seconds

Else

Variable Set Integer %N1% to 1

Else

// If client has no information

If Variable %N1% = 1

Macro Run: Printing Macro - Choose All

End If

End If

 

It was working perfect for like a year! I did create the Printing Macro - Choose All a while back, 2 months? 3 months? I did this because it wasn't hitting my options button and rather than change it numerous places I made it a separate macro (I have choose all, choose last, choose your choice, etc.)

Link to comment
Share on other sites

Well, I can tell you right away that you have a missing "End If"... in between where you set %N1% to 1... and your "If %N1% = 1%. You have "else" between them...

 

Should be:

 

Delay 2 Seconds
Text Type: <ENTER>
// Selects Last Episode
Wait For Window Title: "Episode"
Delay 1 Seconds
Text Type: <ENTER>
Delay 5 Seconds
Wait Window Lose Focus: "Processing"
Delay 1 Seconds
If Window Title "ERROR" is on top
Variable Set Integer %N1% to 0
Text Type: <ENTER>
Delay 2 Seconds
Else
Variable Set Integer %N1% to 1
End If
End If
// If client has no information 
If Variable %N1% = 1
Macro Run: Printing Macro - Choose All
End If

 

Or better yet (and simpler)

 

Delay 2 Seconds
Text Type: <ENTER>
// Selects Last Episode
Wait For Window Title: "Episode"
Delay 1 Seconds
Text Type: <ENTER>
Delay 5 Seconds
Wait Window Lose Focus: "Processing"
Delay 1 Seconds
If Window Title "ERROR" is on top
Text Type: <ENTER>
Delay 2 Seconds
Else
Macro Run: Printing Macro - Choose All
End If

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...
×
×
  • Create New...