Raycast return script of hit object (C#)

Hi! I’m a begginer at coding, so don’t kill me if this is a stupid question and don’t answer with “advanced” coding either, please.
I’m trying to make my player cast a ray and, when it hits any gameobject that has a script, make it run.

For example:
My character look at a door, turning its script enabled. My character look at a key, turning its script enabled and so on…

I know that it is possible to write something like:
GameObject.GetComponent().enabled = true;

But I want something generic, something more like:
GameObject.Scripts.enabled = true; (I know that this doesn’t lol)

Is there any basic solution? Any suggestion? Thanks for the attention.

Honestly it’s a strange request to enable ALL scripts (in which case the only way has been suggested by getyour411 in the comment to your topic), I’d suggest to create a basic script for example YourBaseClass (even empty, no variables/methods) that you will inherit in the scripts that you want to target and then use GetComponents of YourBaseClass (it will return both YourBaseClass and inherited scripts)