Wake From Nib & Cannot Create Script Command Error

I am trying to load data into text fields on different tabs when the nib is created. But this only works if the tab that is receiving the data is active on the initial nib launch. If I tell a text field to update with data that isn’t active on the initial nib start up I get a “NSCannotCreateScriptCommandError(10)”


on awake from nib the_object
	try
		set contents of text field "DataField1" of tab view item "Tab2" of tab view "TabSet1" of window "MainWindow" to theData as string
	on error theErr
		log theErr
	end try
end awake from nib

Would it be better to load the data into the text field when that tab is selected by a click? If so, how would selecting a tab work? It doesn’t look like the “On click” works in this case.

thanks in advance.

strange… i recreated the nib section for that script and it works fine…