Scripting Signatures in Lion Mail

I discovered that Apple has made Mail Signatures scriptable (at long last!). Unfortunately, the below script creates a new signature but doesn’t actually save it & worse, makes Mail’s Preferences window unresponsive. Any ideas?


set myContent to "-- 
"

set myContent to myContent & (the clipboard)

set myTitle to ""

tell application "Mail"
	set signatureCount to ((count of signatures) + 1)
	display dialog ¬
		"Give your signature a name" with title ¬
		"Signature Name" default answer "Signature #" & signatureCount ¬
		buttons {"OK", "Cancel"} default button 1
	copy the result as list to {text_returned, button_pressed}
	set myTitle to text_returned
	set theSignature to make new signature at beginning of signatures with properties {content:myContent, name:myTitle}
end tell




Model: MBP 15", Mid 2010
AppleScript: 2.2
Browser: Safari 534.48.3
Operating System: Other

If its any consolation I got the same result with this simple script :(…

tell application "Mail"
	set sigContent to "signature content"
	set sigName to "signature name"
	set newSig to make new signature at end of signatures with properties {content:sigContent, name:sigName}
end tell