Title: Re: Grab new signature script?
On 3/20/01 1:14 PM, "Rich Hansen" <[EMAIL PROTECTED]> wrote:

> on 3/20/01 1:06 PM, Ray Kloss at [EMAIL PROTECTED] wrote:
>
>> I had some nice scripts I used for Outlook Express. Can I modify them for
>> Entourage or are they available for it? I likes one that would grab the
>> selected area for a random signature.
>>
> I second the motion. I can't modify the Outlook one because of the way that
> it was saved. I also, yet, haven't tried it in Entourage but ...


I haven't checked the OE one. I've done a brand new script here instead. it will work from Notes or any text in Entourage (like the Notes for calendar events or tasks) as well as from message text. When you run it the first time, it asks you if you want to include your name above the selected text for random sigs. It suggests your display name from your default email account, but you can change it to anything you want, or click No. If you ever want to change this preference, run the script while holding down the Command key with Jon's Commands osax installed in your Scripting Additions folder. (You can get it free at http://www.osaxen.com).

And that's it. It creates a new random sig (listed in the list of signatures with the beginning of the the text as its name), and confirms to you that it's done this.


---------------------MAKE RANDOM SIG------------------

property useName : ""
property dName : ""

try
    if (keys pressed) = {"Command"} then set useName to "" -- Jon's Commands
end try

tell application "Microsoft Entourage"
    
    
    if useName = "" then
        set dName to full name of (get default mail account)
        
        if dName � "" then
            set p to "\"" & dName & "\""
            set q to "an alternate"
        else
            set p to "your"
        end if
        
        set dispD to display dialog "Do you want to include " & p & " above your selected text in the random signatures?" & return & return & "You can enter " & q & " name here:" default answer dName buttons {"Cancel", "No", "Yes"} default button "Yes" with icon 1
        if button returned of dispD = "Cancel" then
            return
        else if button returned of dispD = "Yes" then
            set useName to true
            set dName to text returned of dispD
        else
            set useName to false
        end if
    end if
    
    try
        set theSelection to the selection
        if class of theSelection � string or theSelection = "" then error number -128
    on error
        beep 2
        display dialog "! This script only works with selected text." with icon 0
        return
    end try
    
    if useName then
        set r to dName & return
    else
        set r to ""
    end if
    set fullText to "-- " & return & r & return & theSelection & return
    if (length of theSelection) > 13 then
        set theName to text 1 thru 12 of theSelection & "…"
    else
        set theName to theSelection
    end if
    
    make new signature with properties {name:theName, content:fullText, include in random:true}
    
    display dialog "A new random signature has been made from your selection." buttons {"OK"} default button "OK" with icon 1
    
end tell

-------------------------end script---------------------

Let me know before I post this to applescript central if you think there's any feature missing.


--
Paul Berkowitz
  • ... Ray Kloss
    • ... Rich Hansen
      • ... Paul Berkowitz
    • ... Paul Berkowitz
    • ... Gary
    • ... Paul Berkowitz
    • ... Gary
      • ... Paul Berkowitz
      • ... Paul Berkowitz
      • ... Paul Berkowitz

Reply via email to