Add gameObject/transform to script component slot with editor

Hi, I want to be able to fill Transform and gameobjects in script components slots with a seperate Editor script. I assume this would be the same as filling the slots at runtime.

pupilCTRL is the script attached to the eyeInnerR asset. In this script component there is an empty transform slot by the name of Other. This is where I want to drop the gameobject Cube.

Any help would be appreciated

         GameObject PupilRCTRL = GameObject.Find("eyeInnerR");
         Component PupilRCTRLCheck = PupilRCTRL.GetComponent<pupilCTRL>();
         if (PupilRCTRL != null && PupilRCTRLCheck == null)
             GameObject tester = GameObject.Find("Cube");

So other is just a public field like this (which appears as a slot in the inspector)?

public Transform other;

In that case, you can just write:

PupilRCTRL.GetComponent<pupilCTRL>().other = tester.transform;