Attaching script to object during runtime doesn't work. New to unity3d. What am I doing wrong?

Hi! I looked in the forums as well, and all they really say is use the GameObject.AddComponent API, but well, that doesn’t seem to work.
Here’s my code (C#):

GameObject someGameObject = (GameObject)Instantiate(somePrefab, position, rotation);
BlueColour script = someGameObject.AddComponent<BlueColour>();

I run the scene, and nada, the script does not execute.
I tried script.enabled = true; too and nothing.

Help? :slight_smile: Please…

Thank you!

Thank you everyone for your replies, I got it figured it out.
I made a mistake with firing the wrong method when attaching the script. Thank you for all your help!

public Component somescript;
public GameObject somedude;

        somescript = somedude.AddComponent("BlueColour");