how to change entourage event properties of existing event

Hi,
i’m pretty new to scripting - i’m trying to write a script that will take an open calendar event and change the subject and location properties. i’ve seen plenty of examples to do this when creating a NEW event, but can’t seem to find some snippets to do this with an existing event.

here’s what i’ve tried…


tell application "Microsoft Entourage"

	activate
	
	set theWindow to window "test ” Calendar"  -- this window will be open upon the script launching & its a calendar invite
	tell theWindow
		set theMsg to displayed message of theWindow
	end tell
	set properties of theMsg to {subject:"new test", location:"new location"} -- ultimately these new properties will be variables
end tell

i’ve tried some other things, none of which seem to work…

can someone offer some hints/suggestions?
thanks

Hi,
I think you’ll have to address the single properties of your event individually, for example:

tell application "Microsoft Entourage"
	set e to event 1
	set s to subject of e --> displays old subject of this event
	set subject of e to "My new event"
	set location of e to "My new location"
end tell

Ciao
Farid

Thanks for your reply…

the code seems to run, but it doesn’t do anything.

how do I get at the event ID, name or whatever (where you have event 1)?

event 1 doesn’t seem to correspond to the calendar invite i have open…

thanks

Edited-noon; 12/23

ok, i see, you can simply reference the event by the name of the event, which appears to be the same as the subject, so,


set theEvent to event "test"
set subject of theEvent to "new subject"

of course then you have to contruct a new event name if you want to do anything with it, e.g.,


set theEvent to event "new subject"

thanks again for your help… everything’s working fine for me.