Script will wait recording is finished