On 6/23/02 11:03 AM, "Domains4Days.com" <[EMAIL PROTECTED]> wrote:

> Just curious if anybody has an ideas about this...
> 
> ====
> 
> Entourage calendar help ...

I think you mean "AppleScript help"?
> 
> I'm having trouble ... How do I set the Start Date / End Date and Start Time
> and End Time for a new entry???

If you look in the Entourage AppleScript Dictionary, you'll see that 'start
time' and 'end time' (not separate date and time, it's all one entry for
each) are AppleScript 'date' data type, NOT 'string'.

> 
> 
> ... Assuming that I had previously set some of these variables earlier in
> the code... Then ...
> 
> 
> tell application "Microsoft Entourage"
>   activate

Do you really need to activate?
>   
>   
>   -- get the information from the message, and store it in variables

You're not getting the information from the message, you're apparently
setting it from scratch, no?

>   set theName to vNam
>   set theCategory to "Cool"
>   set thePriority to "High"
>   set theContent to vBod
>   set theStartDate to "07/02/02"
>   set theEndDate to "07/02/02"
>   set theStartTime to "???10am ???"
What are those ??? for?

    set theStartTime to "10:00 AM"
    set theEndTime to "2:00 PM"

>   set theEndTime to "???2pm ???"
>   
    set theStartTime to date (theStartDate   & " " & theStartTime)
    set theEndTime to date (theEndDate & " " & theEndTime)


A lot easier is if you can just set them as one item to begin with, if
you're not getting the information from separate places. Just do this
instead:

    set theStartTime to date "07/02/02 10:00 AM"
    set theEndTime to date "07/02/02 2:00 PM"

If you do it that way you'll see something very interesting happen when you
compile.

BUT: in OS 8/9 (at least up to about 9.1, maybe later) you can't set dates
within application tell blocks. So either you should do all this before you
start 'tell application "Microsoft Entourage"' or else, if it really must be
inside the tell block, you'll have to put:

    tell me to set theStartTime to date "07/02/02 10:00 AM"
    tell me to set theEndTime to date "07/02/02 2:00 PM"

or 

    tell me to set theStartTime to date (theStartDate   & " " &
theStartTime) 
     tell me to set theEndTime to date (theEndDate & " " & theEndTime)

 
> ... WHAT DO I PUT HERE ....?:
> 
>   set newEvent to make new event with properties {subject:theName,
> content:theContent, ?????start time:theStart???? End date --- starttime end
> time etc.}
>   
>   open newEvent


These bits are really the only parts you need to put in the tell block, and
now it will just work with

    start time:theStartTime, end time:theEndTime


AppleScript Dictionaries are very precise about telling you what data type
you need. Except that wherever the Entourage Dictionary says 'Unicode text'
you can just use regular text, and there's one error in the Entourage 2001
Dictionary which is really an error in the Apple Required Suite

    save -- alias

actually takes a string (text) file path, NOT an alias or file type.
> end tell
> 
> 
> 
> ===========
> 
> 
> 
> Class event: A calendar event
> Plural form:
>   events
> Properties:
>   ID  integer  [r/o]  -- the event's unique ID
>   subject  Unicode text  -- subject of the event
>   location  Unicode text  -- location of the event
>   content  Unicode text  -- description of the event
>   start time  date  -- time at which the event starts

See ? It says 'date' , not 'string' or 'Unicode text'.  You can read about
'date' data type in the AppleScript Language Guide, which is a free download
at yen Apple AppleScript web page.

>   end time  date  -- time at which the event ends

'date' again.

>   all day event  boolean  [r/o]  -- is the event an all day event?
>   recurring  boolean  [r/o]  -- is the event recurring?
>   category  a list of reference  -- the list of categories
>   links  a list of reference  [r/o]  -- the list of linked items
>   properties  record  -- property that allows setting a list of properties
> 
> 
> THANKS IN ADVANCE...

You're welcome.

-- 
Paul Berkowitz


-- 
To unsubscribe:                     
<mailto:[EMAIL PROTECTED]>
archives:       
<http://www.mail-archive.com/entourage-talk%40lists.letterrip.com/>
old-archive:       
<http://www.mail-archive.com/entourage-talk%40lists.boingo.com/>

Reply via email to