C# GetComponents (not mixing with JS)

The manual contains this exact line on the topic:

HingeJoint[] hingeJoints = GetComponents<HingeJoint>();

I want to use the same functionality with scripts, so I wrote:

using UnityEngine;
using System.Collections;

public class Switcher : MonoBehaviour {

	void SwitchTo(string target)  {
		Script[] scripts = GetComponents<Script>();
	}
	
}

and Unity replies:
Assets/Scripts/Menus/Switcher.cs(7,17): error CS0246: The type or namespace name `Script’ could not be found. Are you missing a using directive or an assembly reference?

Elsewhere in the manual, ScriptName is used for components in C#, but that gives the same error message.

My best guess is that the part in < > is the literal name of the target script, not its type, which makes absolutely no sense in the context (but seems to work for GetComponent, the singular case). It also has the disadvantage that there’s no way to set the name at runtime (via a variable), because it doesn’t accept a variable in that place.

I’m really confused right now. There seems to be a C# function that can not possibly do what it claims to do. What am I doing wrong?

you must use a real class that extends from MonoBehavior, not script or scriptname. Those are just dummy names for you to replace

Ok, I guesses almost as much.

My question is still: Is there any way to determine the component I’m looking for at runtime?

No, the point of generics is that you define it at compile time.

If you want to look for something at runtime use the old way

GetComponents(typehandle)

where typehandle is typeof(classYouLookFor) and then cast the result

Ah. That’s the puzzle piece I was missing. Thanks.