Can I run: GameObject.FindGameObjectsWithTag ("TAG") in Custom Editor?

I’m trying to get the Game objects of a certain tag in my custom editor popup, so using the example provided, I paste: var respawns = GameObject.FindGameObjectsWithTag (“Respawn”); but I get the following error: “UnityException: You are not allowed to call this function when declaring a variable.
Move it to the line after without a variable declaration.
If you are using C# don’t use this function in the constructor or field initializers, Instead move initialization to the Awake or Start function.”

I tried backing up (copying the code), deleting the script and recreating it as suggested in this pos: Error message : You are not allowed to call this function when declaring a variable. - Questions & Answers - Unity Discussions but the solution does not work for me.

Any ideas?

The reason it doesn't work is exactly as the error says- you can't use this kind of method in the variable declaration step! You should do something more like this-

var respawns : GameObject[];

function Awake()
{
    respawns = GameObject.FindGameObjectsWithTag("Respawn");
}