Bug broke my mail script in Tiger

There seems to be a new problem with Mail.app, Applescript in Tiger (10.4.0,1,2)

The following code-snippet worked like a dream in all previous versions of OS X, but has consistently broken in Tiger with the message:

“Mail got an error: NSInternalScriptError”

I create various signature ‘templates’ that all have ‘template’ in their names. I then run through them all and modify them on the fly so that my signature is ‘randomized’ with a new quote from various sources.

tell application "Mail"
			set sigs to every signature -- get every signature, duh
			repeat with i from 1 to the number of items in sigs
				if the name of item i of sigs contains "template" then --look for templates
                                   set this_sig to item i of sigs
					set sig_n to word 1 of (the name of this_sig as string) --name of non-template signature
					if not (exists signature sig_n) then --makie sure it's already a signature
						make new signature with properties {name:sig_n} --create it if it's not
					end if
					set sig_tmpl to the content of item i of sigs --get its contents if it is
					set content of signature sig_n to sig_tmpl & "my new quote"
                            end if
			end repeat
		end tell

The Dictionary for Mail.app still claims to have the ‘content’ field, but you can no longer write to it. This blows. :slight_smile:

So I tried, as an alternative, deleting the signature in question, then re-creating it. All this serves to do is a) create a DUPLICATE signature of the same name – the delete never happens, no error – and then the Preferences pane of Mail.app hangs forever and you have to quit Mail.app

If ANYONE has any insight on this one, I’d really love to have this feature back, as I have had randomized signatures since 1991 on UNIX, Linux, Mac OS X, and even Windows.