The party obtaining a postponement of a trial in any court of record must, if required by the adverse party, consent that the testimony of any witness of such adverse party who is in attendance be then taken by deposition before a judge or clerk of the court in which the case is pending or before such notary public as the court may indicate, which must accordingly be done, and the testimony so taken may be read on the trial with the same effect and subject to the same objections as if the witnesses were produced.
§ 25-4-504, MCA