The *real* problem, though, of which my original question is just a
special case, is that there is no way to navigate from the message in
its own window to the same message listed in its folder.
Yup, did that. But I don't know how to select the message. I've tried
various incantations involve "selection" but they didn't work. Do you
know a way, in AppleScript, given a message id and the folder id that
contains it, to select that message in that folder's browser window? m.
'selection' can be of three possible classes: text (Unicode text now in
2004), folder (in the Folders list), and list (items in lists - messages,
contacts, events, etc.). If it's a single message or other item, put list
brackets around it:
tell application "Microsoft Entourage"
set theMsg to item 1 of (get current messages)
set theLinks to links of theMsg
repeat with aLink in theLinks
if {class of aLink} is in {incoming message, outgoing message} then
set theFolder to storage of aLink
set displayed feature of main window to theFolder
set selection to {aLink}
exit repeat
end if
end repeat
end tell
That will usually work. You might occasionally get issues of focus where you
need to tab by GUI scripting, but it seems to be working OK now, at least
for messages. For contacts, tasks, etc. you can't set displayed feature, but
you can set displayed area. Then set selection to the list of items you want
to select.. Folders and custom views only can be displayed feature.
BTW, there's a command missing from the dictionary, Standard Suite:
select [reference] -- reference to an open window
In Entourage that means "bring the window forward". In OS X that only works
when Entourage is the front app (similar to Word, Excel an many other apps).
In any case 'open' will work just like 'select' if the window is already
open. ('select' is useful in a try block if you want to bring forward a
window if it's open but NOT to open it if it isn't.)
--
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.