script to create calendar event

H

Holman, David

I need to script the creation of a new public calendar event so that I can
control a couple of options. I'm not familiar with AS for Entourage at all,
so I'm hoping for a few pointers.

here's the idea: the user will go to the calendar in question (myCal),
select the day, and select the script from the script menu, which will bring
up the dialog for a new untitled event on myCal with the reminder turned off
(regardless of the user's local preference), and busy status set to Free. I
believe everything else can use the default settings.

app details: Entourage 2004 11.2.5 (060620) on an Exchange Server which I
believe is 2003. I'm on Panther (10.3.9) and most other users are on Tiger.

I posted this last week, but maybe I was too long-winded with the
back-story. any hints would be much appreciated.
 
B

Barry Wainwright [MVP]

I need to script the creation of a new public calendar event so that I can
control a couple of options. I'm not familiar with AS for Entourage at all,
so I'm hoping for a few pointers.

here's the idea: the user will go to the calendar in question (myCal),
select the day, and select the script from the script menu, which will bring
up the dialog for a new untitled event on myCal with the reminder turned off
(regardless of the user's local preference), and busy status set to Free. I
believe everything else can use the default settings.

app details: Entourage 2004 11.2.5 (060620) on an Exchange Server which I
believe is 2003. I'm on Panther (10.3.9) and most other users are on Tiger.

I posted this last week, but maybe I was too long-winded with the
back-story. any hints would be much appreciated.

I didn't see your post last week, but if you are looking for a starting
place, there should be a script in the Entourage Script Menu called 'Create
Event from Message' - that should give you the syntax for creating events.
All you will need to do is to hard-code the information you desire.

Please write back if you need more help than this.
 
H

Holman, David

-- Barry Wainwright said:
there should be a script in the Entourage Script Menu called 'Create
Event from Message' - that should give you the syntax for creating events.

thanks, Barry! I did take a look at that sample script, and between that and
the app dictionary I got this far:

set newEvent to make new event with properties {has reminder:false, free
busy status:free}

there are two things things I haven't been able to solve, though:

1 - I still want the user to be able to select the day they want in the
calendar on their screen and assign it to a variable. if they don't have a
date selected, I'd like to just set that variable to the default.

2 - I'd also like them to be able to select the date on the calendar they
want the event posted to and assign that calendar to a variable. this I
don't even know how to set in the properties, let alone grab it from their
selection. I've tried hard-coding the specific calendar I want, but I'm not
even sure how to do that. I saw that there is a "calendar" property for
creating an event, but I can't figure out what info to provide.

_ DA Holman _
 
H

Holman, David

I forgot about one more thing I'd like to turn off. I can't figure out how
to get to the "request responses" setting. the default of having this on
hasn't caused any trouble so far, but just in case...

_ DA Holman _
 
M

Mickey Stevens

You can add this to the bottom of your script to toggle that option:

tell application "System Events"
tell process "Microsoft Entourage"
pick menu item "Request Responses" of menu "Event" of menu bar item
"Event" of menu bar 1
end tell
end tell

For this to work, first, open System Preferences, and then open Universal
Access preferences.
Make sure the checkbox to "Enable access for assistive devices" is checked,
and then quit System Preferences and re-launch Entourage.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top