Changing Signature in Mail.app

I wrote a script some time ago that puts a new fortune into my Mail.app signature. However, it doesn’t seem to save the signature between restarts of the application, unless I manually open and then close the Preferences window (and the Signatures pane of this window). How bizarre!