Assigning script to gameobjects on Awake

Usually I could assign gameobjects to my script on the inspector panel, but my gameobjects are being spawned via script so I want to assign these on Awake instead. My code looks a little like this -

private CharacterUI myCharacterCollection;

now i want to assign myCharacterCollection to a gameobject on Awake -
The problem is that since it is utilizing CharacterUI (which is my other script) it won’t let me use gameobject.find

When you spawn (instantiate) them have that script use AddComponent to add your required script the prefab that gets instantiated.

GameOnjet go = Instantiate(someObject, Vector3.zero, Quaternion.identity) as GameObject;

go.AddComponent<yourScriptNameHere>();