Read a part of a window

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
CatBreath
Junior Coder
Posts: 32
Joined: Fri Jul 08, 2005 6:12 pm

Read a part of a window

Post by CatBreath » Thu Jul 21, 2005 12:05 am

I need to find how many messages there are in an outlook folder.

If I were human i would simply read this small line of text:
Image

But I'm a macro script... so is there any way of reading that?


Thanks!

CatBreath
Junior Coder
Posts: 32
Joined: Fri Jul 08, 2005 6:12 pm

Post by CatBreath » Thu Jul 21, 2005 12:23 am

oh i can just click the properties of the folder and GetWindowText it...

But just out of curiosity and for future reference is there a way of reading that part of the window?

CatBreath
Junior Coder
Posts: 32
Joined: Fri Jul 08, 2005 6:12 pm

Post by CatBreath » Thu Jul 21, 2005 12:28 am

and one last question:
how do I position the cursur on the "Inbox" without giving it the explicit coordinates?

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 » Thu Jul 21, 2005 3:07 am

I can't give you the code, but I am quite sure you can use VBScript and the OutlookExpress objects to get the count of messages in any folder. This will eliminate the need to try to position the cursor.

And you can use keystrokes to highlight the folder you want.
CTL-Y will open the GoTo Folder window. Press "I" (or press Down arrow as needed) to go to the Inbox, press Enter.

Now you may be able to use the coordinates of the Window to locate the lower left position and scrape the folder count somehow (No ideas on that yet. Stay tuned for input from others).
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

CatBreath
Junior Coder
Posts: 32
Joined: Fri Jul 08, 2005 6:12 pm

Post by CatBreath » Thu Jul 21, 2005 11:52 am

Thanks for the reply.

key strokes is still a bit primitive, i'm looking for a way to be on the folder without me counting anything (pixels/key strokes), a way that wont require me to know where it actually is.

Oh and thanks to that Ctrl-Y of yours i figured out a way:
Press Ctrl-Y to get the select window popup, click the "Create New
Folder" and there type in the folder you want.
If it exists and it is a direct subfolder of "Local Folders" (meaning its not a subfolder of another folder) than it'll open that existing folder, Hurray!

But that still feels a bit primitive...
Is there a way that will work independent of outlook's features?
A way that i could use in other cases aswell?

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Thu Jul 21, 2005 12:07 pm

That's a status bar so you should be able to use GetControlText on it. Look in Tools/View System Windows and see if it shows up there. If so you can use GetControlText.
MJT Net Support
[email protected]

CatBreath
Junior Coder
Posts: 32
Joined: Fri Jul 08, 2005 6:12 pm

Post by CatBreath » Thu Jul 21, 2005 1:12 pm

it works! awesome!
Thanks!

any ideas about the positioning the curser over the right folder? (without knowing where it is)

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 » Thu Jul 21, 2005 2:12 pm

Not a solution, but just a comment that you should be referencing Outlook Express. It is not the same as Outlook. The names are frequently misused and can cause some confusion.

So far the solutions being proposed here will work with both, but if you did try to use VBScript, a different set of objects would be needed.

What is your definition of "primitive"?
Using keystrokes is primitive?
"A way I can use in other cases"?....what does that mean?

If not using keystrokes and mouse movements, then you will have to be working with underlying code such as VB/VBScript or some other language.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

CatBreath
Junior Coder
Posts: 32
Joined: Fri Jul 08, 2005 6:12 pm

Post by CatBreath » Thu Jul 21, 2005 2:36 pm

firstly i meant no offence of course.

and primitive I call ways that you have to know where the object is in order to get to it.
such as counting key strokes or counting pixels, i want the whole thing to be automatic and independent of human counting.
I want to tell my script a name of a folder and i want it to find that folder and click on it.

Thanks for all your help guys!

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 » Thu Jul 21, 2005 9:26 pm

No offense felt.......just curious so could provide better help....
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

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