Script failing, mesh spray, "quack" is not generic

I am trying to do a mesh spray custom editor, but keep hitting two problems with EditoGuiLayout.objectfield and the “quack” is not a generic function

	class MyWindow extends EditorWindow {

var particleOne;
var selmesh ;
 
 
    @MenuItem ("Window/My Window")
    
      static function Init () {
         // Get existing open window or if none, make a new one:        
         var window : MyWindow  = ScriptableObject.CreateInstance.<MyWindow>();
 
         window.Show();
     }

    function OnGUI () {

GUILayout.Label ("spawnonmesh", EditorStyles.boldLabel);

particleOne = EditorGUI.ObjectField(new Rect(3,3,position.width - 6, 20),"sprayobject",particleOne,typeof(GameObject));
selmesh = EditorGUI.ObjectField(new Rect(3,3,position.width - 6, 20),"Blablabla",selmesh,typeof(GameObject));
 
 if( GUILayout.Button ("apply")){
 
   RandomAdd();
  
   }

    }
    
     
 var pointa:Vector3=Vector3.zero;
 var pointb:Vector3=Vector3.zero;
 var pointc:Vector3=Vector3.zero;

function RandomAdd () {


     var baseVertices : Vector3[];
     var mesh : Mesh = selmesh.GetComponent.<MeshFilter>().mesh;
     
      for(var f:int=0; f<particleOne.Length; f++){
     
     for(var i:int= 0; i < mesh.triangles.Length; i += 3){
     var rndA = Random.value;
     var rndB = Random.value;
     var rndC = Random.value;
     pointa = mesh.vertices[mesh.triangles[i + 0]];
     pointb = mesh.vertices[mesh.triangles[i + 1]];
     pointc = mesh.vertices[mesh.triangles[i + 2]];
var rndTriPoint = (rndA * pointa + rndB * pointb + rndC * pointc) / (rndA + rndB + rndC) ;
     Instantiate (particleOne[f], rndTriPoint, Quaternion.identity);
     }
     
     }
}

}

I am confused…

Apparently this part is “quack”

     var mesh : Mesh = selmesh.GetComponent.<MeshFilter>().mesh;

You didn’t type your variables:

var particleOne;
var selmesh;

Either add a type explicitly, or add it implicitly by supplying a value.