How to get the timer remaining time usiing JavaScript

Problem: I would like to get the remaining time of a slide timer using JS

ActivePresenter version: 8

OS: Windoess 10


Hi Pedro,

In the current version, there’s no function to get the timer remaining time.
However, you can use prez.elapsedTime() to save the timer start time and calculate the timer remaining time:

// script to save the presentation elapsed time when the timer start
prez.myTimerStartTime = prez.elapsedTime();

// script to get the timer remaining time
var timerElapsedTime = prez.elapsedTime() - prez.myTimerStartTime;
 // replace timerDuration in the line below by your actual timer duration
var timerRemainingTime = timerDuration - timerElapsedTime;