Re: scripting Entourage shared calendar
Re: scripting Entourage shared calendar
- Subject: Re: scripting Entourage shared calendar
- From: Paul Berkowitz <email@hidden>
- Date: Sun, 18 Jan 2009 10:21:54 -0800
- Thread-topic: scripting Entourage shared calendar
I'm running blind here since I don't have an Exchange account, so I can't
check things out for myself.
Is a "shared calendar" of the type you're talking about the same thing as a
delegated calendar, i.e. calendar of a delegated account? Or is it "vice
versa"?
There is more than one way to try to access delegated calendars. If they do
not show up under 'every calendar' of the main account - which makes sense
to me, actually - first get 'every delegated account' of the main account.
(You'll see 'delegated account' as an element of the 'Exchange account'
class.) 'delegated account' has calendar elements: I'm going to guess that
every calendar of a delegated account will find every delegated calendar you
can see in the UI. So, by name or by by index, if not also by ID, you'd
eventually refer to it via
calendar "CalName" of delegated account "AcctName" of Exchange account
1
>From what you say, these calendars would not be showing up simply as
'calendar id 123' since it appears they are not elements of the application
nor of the Exchange account as such, but *only* of the delegated account. I
rather like this sort of containment model. You'll notice that 'calendar'
element, whether of the application, of an Exchange account, or of a
delegated account, is supposed to be accessible only by index or by whose
filter, not even by name, let alone unique ID. So it should also turn up as
calendar 2 of delegated account 1 of Exchange account 1
The unique IDs seem to be a sort of "bonus" for some classes - that the
application as a whole keeps track of all of them: that applies to folders,
for example, and also - it seemed until now - to calendars and address
books. But maybe not to calendars and address books belonging to delegated
accounts. (Note that 'Exchange calendar' class, which is a subclass of
'calendar' has a 'kind' property that includes 'Exchange delegated' as one
type (constant). Its description is "accessed as a delegate".)
After all this, if a "shared account" of the type you're talking about is
*not* a delegated account but, say, an account of which your account is the
delegate account (shall we call it a "reverse-delegate"?), it may be
inaccessible to AppleScript. But without knowing more about it, I can't say.
However, I think that any object, such as a calendar. that you can see in
the UI you should be able to access by AS if you know the object model.
(Here's a hint that might possibly be useful: I think that public folders,
as such, are not available to AppleScript. But if you make one a "favorite"
it does become accessible as one of the folders of the Exchange account.
Perhaps that might apply to this sort of calendar too - it's worth a try,
anyway, if such a thing is possible.)
--
Paul Berkowitz
> From: Peter Robertson <email@hidden>
> Date: Sun, 18 Jan 2009 08:53:17 -0500
> To: AppleScript-Users <email@hidden>
> Subject: scripting Entourage shared calendar
>
>
>
>
> Does anyone know how to add events to a shared exchange calendar?
>
> I'm able to add events via applescript when I am using the account to which
> the calendar belongs but when trying to script it via another user account
> which has access privileges I can't figure out how to refer to the shared
> calendar. I can't seem to get the calendar id of the shared calendar so I can
> refer to it.
>
> With an exchange calendar which is NOT being shared I can just refer to it by
> calendar id which can be obtained by using--
>
> set theCals to every calendar of Exchange account "account name"
>
> --shared calendar id's are NOT returned with this command because they belong
> to a different Exchange account? How can I refer to a shared calendar which
> shows up as a calendar beneath a second Exchange Account icon inside of my
> Entourage exchange account underneath the calendar tab?
>
> Or I suppose another way to get the calendar id might be to get the calendar
> id of of a selected event.
>
> The script below returns the event id of an event on the shared exchange
> account calendar for which I am trying to find the calendar id. Is there a
> way to get the calendar id of the event id is known?
>
> Thanks.
>
>
>
> tell application "Microsoft Entourage"
> try
> (*get the currently selected event(s)
>
> (in calendar or custom view) *)
>
> set theEvents to (get selection)
>
> if theEvents = {} or class of (item 1 of theEvents) is not event then error
> number -128
>
> on error
>
> (*if there are no events selected, or the first item selected
>
> is not a calendar event, warn the user and then quit*)
>
> beep 2
>
> display dialog "First select an event in the calendar or" & "a custom view.
> Then try again" buttons {"Cancel"} default button 1 with icon 0
>
> end try
> return calendar ID of theEvents???
>
> end tell
>
>
> Pedro
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> AppleScript-Users mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> Archives: http://lists.apple.com/archives/applescript-users
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden