Re: Entourage Current Messages Apple Event
Re: Entourage Current Messages Apple Event
- Subject: Re: Entourage Current Messages Apple Event
- From: Paul Berkowitz <email@hidden>
- Date: Sat, 10 Mar 2001 06:46:25 -0800
On 3/9/01 10:44 AM, "Jed Verity" <email@hidden> wrote:
>
Has anyone experienced problems with <<class CMgs>> (the raw code for the
>
"current messages" method of Entourage)?
>
>
The script below returns "current messages" as an application command (i.e.
>
it's not a string or variable) instead of the list of current messages:
>
>
--begin script
>
--"OPIM" is creator code for Entourage and this script assumes the app is
>
--already running and that a message has been highlighted in any folder.
>
>
set appENT to my GetRightApp("OPIM")
>
>
tell appENT to get +class CMgs;
>
>
to GetRightApp(appCode)
>
tell application "Finder" to get first process whose creator type is
>
appCode
>
set appName to result as +class psn ;
>
end GetRightApp
>
>
--end script
>
Without all the persiflage, it will do the same thing with any application
property, as opposed to an element:
tell application "Microsoft Entourage" to get <<class CMgs>>
-- current messages
(i.e. not the list of selected messages)
tell application "Microsoft Entourage" to get <<class mnWn>>
-- main window
(i.e. not the actual window "Name")
It's an acknowledged bug in the scripting, which they plan to fix "some
time". The usual workaround, in other contexts, of using "get" or setting to
a variable, doesn't work here. Here's how to do it:
tell application "Microsoft Entourage" to get <<class CMgs>> of application
"Microsoft Entourage"
or, in your specific case:
tell appENT to get <<class CMgs>> of appENT
-- {outgoing message id 102543 of application "Microsoft Entourage"}
--
Paul Berkowitz