Title: Re: Grab new signature script?
On 3/20/01 2:09 PM, I wrote:

          I haven't checked the OE one. I've done a brand new script here instead.

Darn. I left out a line, which will error it if you don't use a display name. Here it is again, and slightly improved as well:

------------------------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 "Or you can enter an alternate name here:"
        else
            set p to "your name"
            set q to "Enter the name you want to use here:"
        end if
        
        set dispD to display dialog "Do you want to include " & p & " above your selected text in the random signatures?" & return & return & q 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--------------------

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

Reply via email to