n = marker.numKeys; if (n > 0){ f = timeToFrames (time); idx = Math.min (Number(f)+1, n); marker.key(idx).time }else{ value }