I think I really suck at syntax ... please help

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
Jaylee
Junior Coder
Posts: 45
Joined: Wed Feb 08, 2006 4:48 am

I think I really suck at syntax ... please help

Post by Jaylee » Sun Feb 26, 2006 7:37 am

G'day again,

I'm still struggling with V6 ( :( ) but I strongly suspect that it's my lousy grasp of basic syntax causing me grief rather than the version (just waiting for approval from my boss to upgrade - the wheels move V E R Y slowly ...).

Briefly: I have code opening and processing email messages in Outlook. As each message is completed, it is moved to a different folder. Eventually, the Inbox should be empty. When this happens, I want to go to another mailbox and repeat these actions until it is clear as well. The number of messages is an unknown and I could only think of two ways to identify when the boxes are empty. One is to use the viewing pane in Outlook and use the code "FindWindowWithText". The problem with using this method is that the viewing pane can be very slow to load an existing message so the script sometimes ends prematurely.
The other way I thought of to identify if I've reached the end is to try to locate the open message using WaitWindowOpen. If there's no messages left, no window opens so this should be the cue for the script to move on to the next email box or to end the script until the next scheduled run.
I just don't seem to be able to get the right result from WaitWindowOpen. This is the code I'm trying to use based on how I interpreted the Help files:


Let>WW_TIMEOUT=5.0
WaitWindowOpen>Approved Application*
If>WW_RESULT=FALSE,NoMessages
Label>NoMessages
Message>There are no message windows open.


I've run a log file and the result is that everything hangs at the WaitWindowOpen command.

I've checked for trailing spaces. I've read through a heap of examples in this forum and the Help files. I still can't get it right. I had a far more basic script running but it was very inefficient so I thought I would try to "improve" on it. Please point out where I am going wrong.

TIA. :D

J

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 » Sun Feb 26, 2006 4:11 pm

One observation is that it appears that you will always get the message that "There are no message windows open."

Your IF statement provides no alternate path, and you will always go through NoMessages.
I have also removed decimals from Timeout.
Try modifying like this:

Code: Select all

Let>WW_TIMEOUT=5
WaitWindowOpen>Approved Application*
If>WW_RESULT=FALSE,NoMessages,End
Label>NoMessages
Message>There are no message windows open.
...
...
Label>End
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Jaylee
Junior Coder
Posts: 45
Joined: Wed Feb 08, 2006 4:48 am

Post by Jaylee » Mon Feb 27, 2006 7:53 am

Hello Bob,

Thank you.

Your suggestions work. I might just get the hang of this one day ...

Regards, :D
J

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