Need some help scripting mail settings

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.

gw:

I just wanted to let you know that I have been working on this off and on since your post, and am totally stumped. In fact, it has been absolutely infuriating. It seems that the content of the signature is read only, which makes absolutely no sense. I have tried duplicating, nested tells, accessing text files, and probably some others I have forgotten. I have not tried approaching it via GUI, mainly because I have extemely limited experience in that methodology.

I will keep working on it, and see if I can come up with something. My other ideas involve the GUI and System Preferences angles.

I wouldn’t spend too long on this one, guys - since I’m pretty sure the scripting of Mail’s signatures is broken in Tiger. Sorry… :frowning: