Title: Re: Grab new signature script? - FINAL
On 3/20/01 6:38 PM, I wrote:
Even better, I see on testing that the sig's name is already selected (highlighted) when
it opens, so you can just start typing a new name.
I did it again. I hadn't made the very first correction in my original script, just in the second email, so the last script got that wrong again. Blast. Final (until someone suggest something else):
------------------------------MAKE RANDOM SIG--------------------------
property useName : ""
property dName : ""
try
if (keys pressed) = {"Command"} then set useName to "" -- Jon's Commands
on error --
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
set newSig to make new signature with properties {name:theName, content:fullText, include in random:true}
open newSig
end tell
---------------------------end script----------------------------
--
Paul Berkowitz
