strange problem with textarea

I have this very strange paradox. I have EditorGUILayout.TextArea in OnInspectorGUI funtion. What I want to do is when the play button is pressed, to take whatever is already written in the textarea and do something with this string.

The problem is that when you call EditorGUILayout.TextArea you have to supply the string to edit but I can’t give it a string to edit because it is already in the text area. The paradox is that if I call this function and give it a string I overwrite the original string.

What can I do?

It sounds like you’re looking for something like this.

string myString;

OnInSpectorGUI() {
     myString = EditorGUILayout.TextArea(myString);
}

Is this already what you’re doing? If so, what is it that you want instead? I found it a little confusing to understand your paradox just by reading your text.