Title: Re: Script?: Daily journal as an event
On 3/16/01 8:28 AM, I wrote:

> If no one else wants to take on your challenge, I'll be taking a look at
> it over the next several days ... slowly; a few minutes a day is all I can
> eke out for scripting right now. I think what you want may be possible;
> I'm not yet familiar with what can be done script-wise with events.   
>
Well, a quick look showed me it was quite easy to do, so it is already DONE!

If you have the previous journal script, "Create Dated Journal Entry", you can make a copy and modify the core routine to contain the following code:

set theDate to current date
set datestmp to format_date_using(theDate, "-", {"YYYY", "MM", "DD"})
set timestmp to format_time_using(theDate, ":", {"HH", "MM"})
set sub to "Daily Journal - " & datestmp
--See if the journal event already exists
tell application "Microsoft Entourage"
    set evnt to every event whose subject is sub
    set evntExists to ((count evnt) > 0)
    if evntExists then
        set evnt to item 1 of evnt
        set cntnt to content of evnt & return & timestmp & " - "
        set content of evnt to cntnt
    else
        set cntnt to timestmp & " - "
        set evnt to make new event with properties {content:cntnt, subject:sub, start time:theDate, end time:theDate, all day event:true, category:{category "Personal"}}
    end if
    open evnt
    save the front window
    open evnt
end tell

---- end of script fragment

You will need to retain the two subroutines (handlers) called "format_date_using" and "format_time_using". Replace everything else with the above.

This will created a dated all day event with today's date. If such an event already exists, it will open it and append a new time stamp. Hope this meets your needs! I look forward to trying it out for myself when I next sync my Visor (in an hour or so).

I’ll post the complete script later today.
--
Peace,
Allen Watson <[EMAIL PROTECTED]> XNS name: =Allen Watson
A Mac family since 1984 <http://home.earthlink.net/~allenwatson/>
Applescripts for Outlook Express and Entourage: <http://homepage.mac.com/allenwatson/>

Reply via email to