inputField and grasp event

Hi everyone!
I am working on a project with Leap Motion. Basically, there is an inputField. In the inputField the user will write the distance, in centimeters, for which the grasp event should be triggered. When the fingers get closer than the distance of the user’s input, the grasp event is triggered and a ball is grabbed. That’s because I’m working with people with movement deficits and they can’t fully close their hands.
I’ve written a script that prints the distance between the two fingers at each frame, but I don’t know how to trigger the grasp event using the distance of the inputField. Any advice?

public class Mostra : MonoBehaviour
{
public InputField nameField;
private float thePinch;
Controller controller = new Controller();
float HandPinch;
public GameObject Sphere;

    public void OnSubmit()
    {
        thePinch = float.Parse(nameField.text);   
        Debug.Log("Distance selected: "  + thePinch);
    }
    void Update () 
    {
        Frame frame = controller.Frame();
        List<Hand> hands = frame.Hands;		
        if (frame.Hands.Count == 0) return;
        Hand fristHand = hands[0]; 
        HandPinch = hands[0].PinchDistance;	
        if(HandPinch<thePinch) TriggerGraspEventFunction();
    }
    public void TriggerGraspEventFunction()
    {
        Debug.Log("Active");      //just to be sure that it works
        Sphere.GetComponent<InteractionBehaviour>().enabled = false; 
       //this was a test but it doesn't work and it's not what I need
        }
}

This is what i did so far, but I still struggle to implement the TriggerGraspEventFunction() function that enable the pinch when the hand is almost open