Title: Re: Applescript -- Linking
On 11/3/00 7:25 PM, "Sue Freeman" <[EMAIL PROTECTED]> wrote:

> OK, I now know that I will never be very good at scripting so I bow to
> master scripters Allen, Paul, Bill, et al.  I would like to use a hot key
> combination to open a new task or event window that is linked to the
> selected contact  (Link -> to Existing -> Task ... ) -- I tried to play with
> the Make Task from Message script but got nowhere.
>
> Any help would be appreciated.
>
Well which? Task or Event? or a separate script for each?
-----------
tell application "Microsoft Entourage"
    try
        set theSelection to get selection -- may be none
        if class of theSelection � list or (count theSelection) � 1 or class of item 1 of theSelection � contact then error number -128        
    on error
        beep
        display dialog "You must select just one contact in the address book." buttons {"OK"} default button "OK" with icon 2
        return
    end try
    activate
    set theContact to item 1 of theSelection
    set theName to name of theContact
    if theName = "" then set theName to company of theSelection
    set n to make new task with properties {name:theName} -- or event
    link n to theContact
    open n
end tell
--------

Save the script as a compiled script called “Link New Task \moT” if you want the hotkey to be command-option-T, for example, or “Link New Event \moE” for hotkey command-option-E. Or whatever.
    
    
--
Paul Berkowitz

Reply via email to