Macro taking long time to start

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
minchia
Newbie
Posts: 14
Joined: Tue Apr 28, 2009 8:33 am

Macro taking long time to start

Post by minchia » Mon Jun 01, 2009 6:00 am

Hi All,

my macro is taking ages to start after you hit the run button. i do have a timeout limit in the code set to 18.5 seconds, but i'm not sure if this means the macro will allocate those seconds before it actually starts.

u can see below the first thing it runs is the EXE file then clicks a button withing the EXE window, but when you hit the run button, it opens the EXE file, but then does nothing for about 20-25secs before doing the LCLICK part and moving thru the code.

not sure what the problem is, i've run it on 2 different machines and still getting the same problem. It doesn't seem like a big issue, but because i'm using this prog to manually save over 32000 files, an extra 20secs per file makes the process take a lot longer than it should.

any help is appreciated.
thanks

Code: Select all

//BlockInput>1
Let>k=1
Label>start
Let>WSI_TIMEOUT=18.5
ReadLn>c:\\\PP5\\\OpenMsgAttachment\\\MsgAttachmentIDs.txt,k,line
StringReplace>line, ,,tmpline
If>line=##EOF##,finish
run>C:\PP5\OpenMsgAttachment\OpenMsgAttachment.exe %tmpline%

WaitScreenImage>C:\PP5\OpenMsgAttachment\MsgProg.bmp,20
SetFocus>Open Pro-Planner MSG Attachment
MouseMove>410,343
    lclick

WaitScreenImage>C:\PP5\OpenMsgAttachment\button.bmp,20
//SetFocus>Message*
wait>2.5

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Mon Jun 01, 2009 8:01 am

My guess is that the WaitScreenImage is not finding the image within the 18.5 seconds you have specified. It therefore times out after 18.5 seconds. Thus the approx 20 seconds delay you are noticing. Check to ensure the image you are waiting for does actually exist on the screen. Capture it again using the built in image capture tool. Or maybe you don't need to use WaitScreenImage - can you wait for something else - use WaitWindowOpen or WaitScreenText for example?
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

minchia
Newbie
Posts: 14
Joined: Tue Apr 28, 2009 8:33 am

Post by minchia » Mon Jun 01, 2009 8:07 am

WaitWindowOpen is absolute gold!!

tis performing as it should now, let's see if it lasts.

thanks for that mtettmar.

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Mon Jun 01, 2009 3:11 pm

It sounds like you have a solution thanks to Marcus. But for the future, if you run a log file when the macro runs, you could find exactly which line was causing the 20 second delay. The log file is a great troubleshooting tool.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts