Sending a name?

In my project i need to send the name of the predefined GameObject to another script using javascript. Any ideas?

thanks in advance.

In unity there are lots of ways for objects to communicate with each other, by sending messages, directly calling functions on other scripts, or by reading or setting variables on other scripts. "Object.SendMessage" is just one of many ways available.

For a primer on the best ways to send and get information to and from other objects, these two manual pages are essential reading:

Accessing Other Components

Accessing Other Objects

To give a good answer you need to give more info, like how does the sender know to which object to send the name (is it a script in same object, has it a reference set through the inspector, need it to be send to all possible gameobjects in the scene, ...)?. But you could have a look at GameObject.SendMessage.

You can send the name via a function call on the receiving script.

See this questions and answer for more info on how to make one script call a function in another script:

How do I call a function in another GameObject script?