Title: Re: Grab new signature script?
On 3/20/01 6:27 PM, I wrote:
> Ah. You can just go straight there and change it. Perhaps instead of a
> confirmation dialog, I'll just open the signature itself as a
> confirmation. Then you can either just close it as is or edit it and/or
> its name. That would be quickest, especially for people who don't want to
> rename: this is less annoying than yet another dialog plus the
> confirmation - it saves one step.
>
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.
Here it is again:
--------------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 "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
set newSig to make new signature with properties {name:theName, content:fullText, include in random:true}
open newSig
end tell
------------------------------end script--------------------------------
--
Paul Berkowitz
