function malty_formatTime(t, fps, smtp){// t - time in seconds (like app.project.activeItem.time)// fps - framerate (not frame duration) - app.project.activeItem.frameRate// smtp - boolean (optional. if true the result is presented in timecode, if false the result is in frames)var currentSetting = app.project.timeDisplayType;app.project.timeDisplayType = (smtp==true) ? TimeDisplayType.TIMECODE : TimeDisplayType.FRAMES;var result = timeToCurrentFormat(t, fps);app.project.timeDisplayType = currentSetting;return result;}