Changing Pane Focus within Entourage with AppleScript

K

Ken Hilburn

I am trying to do some applescripting to get a list of items from an
Entourage Custom View. I have (with A LOT of help from this news
group) gotten to a point where I can open the pre-defined custom view,
make menu selections (look here to see how:
http://groups-beta.google.com/group...read/thread/171b2582db5b24c3/deb9c10ca1fc4c12
) and even select all items in the view and perform the intended action
on those items.

The only problem that I'm having is that when the Custom View initially
displays, the search box has the focus, not the list of items; so I
cannot select the items from the list that I need.

So now the question: How do I change the focus of the new window from
the search box to the custom view results pane?

I've tried the UI Element Inspector, but apparently the different panes
within Entourage are not "visible" by the Universal Access System.
 
P

Paul Berkowitz

I am trying to do some applescripting to get a list of items from an
Entourage Custom View. I have (with A LOT of help from this news
group) gotten to a point where I can open the pre-defined custom view,
make menu selections (look here to see how:
http://groups-beta.google.com/group/microsoft.public.mac.office.entourage/brow
se_thread/thread/171b2582db5b24c3/deb9c10ca1fc4c12
) and even select all items in the view and perform the intended action
on those items.

The only problem that I'm having is that when the Custom View initially
displays, the search box has the focus, not the list of items; so I
cannot select the items from the list that I need.

So now the question: How do I change the focus of the new window from
the search box to the custom view results pane?

I've tried the UI Element Inspector, but apparently the different panes
within Entourage are not "visible" by the Universal Access System.

That is correct. However GUI scripting also lets you emulate keyboard
actions. So you can emulate pressing the tab key. Except this one is tricky
since it's not listed as one of the modifiers for 'keystroke' in System
Events. Use the fact that the 'tab' constant is the same as typing the Tab
key. Do it three times to get to the message list from the search filter (is
that really where you end up?) I've added one more line in case you want to
select all. Then back in Entourage, you can get the selection:


tell application "Microsoft Entourage"
activate
end tell
tell application "System Events"
tell process "Microsoft Entourage"
keystroke tab
keystroke tab
keystroke tab
keystroke "a" using command down -- select all
end tell
end tell
tell application "Microsoft Entourage"
set completeList to the selection
end tell
--> list of 437 items, or whatever


--
Paul Berkowitz
MVP MacOffice
Entourage FAQ Page: <http://www.entourage.mvps.org/faq/index.html>
AppleScripts for Entourage: <http://macscripter.net/scriptbuilders/>

Please "Reply To Newsgroup" to reply to this message. Emails will be
ignored.

PLEASE always state which version of Microsoft Office you are using -
**2004**, X or 2001. It's often impossible to answer your questions
otherwise.
 
Top