NSRecieverScriptEvaluationError only after window reopens

	tell window "inspector"
		set enabled of button "inspector_apply" to false
		set contents of text field "gt" to gt
		set contents of text field "real_name" to rn
	end tell

This code (on Tiger) works swimmingly the first time in preperation for the window to open, but after I close the inspector window and try to run this code again, I get an error. Any ideas why? Tiger seems to be much more picky than Panther was.

I don’t know if this is any help but I had exactly the same problem with Tiger.
My program could be ‘restarted’ in Panther if the user closed the main-window. Then the initial window became visible again. I had this code in the ‘will close’ handler and that that worked well under Panther but Tiger reports exactly the same error you mentioned when I close the main-window for the second time. I have created a workaround by making a ‘Restart’ button in my main-window which makes the main-window invisible and the initial window visible again. I disabled the close button.

John

I added an e-mail from the Applescript Studio mailinglist:

John is correct, as I posted on Wednesday:

http://bbs.applescript.net/viewtopic.php?t=11150

Jon