I have a script that is used to standardize our signatures. The idea is for each user to run the script which will collect the proper information for each user and combine it into a standard signature. Setting up the text for the signature is all working fine. My problem is setting that signature in mail and making it the default. Here is the relevent segment of the script:
tell application "Mail"
set sigcount to count of signatures
repeat with i from 1 to sigcount
set signame to name of signature i
delete signature named signame
end repeat
make new signature at beginning of signatures with properties {name:"Standard", content:usersig as string}
set selected signature to "Standard"
save
end tell
The script first deletes any existing signatures (this part works). It then sets the proper signature, makes it the default then saves it. The problem I have is the text (content) of the signature does not get set. An empty signature named “Standard” is created. Mail itself is in some odd state when the script ends. Preferences will not come up (selecting it acts like a NOOP). I have to quit mail and relaunch it to see the result of the script. Can someone see what I am doing wrong? TIA.