Milliseconds to Seconds Converter
Quickly calculate Milliseconds to Seconds
This is a quick Macro that will activate when I need to convert the number on the clipboard (Milliseconds) to seconds.
In Action...
I simply select the value, then type in my trigger action keys: .mill then the value gets typed in.
So 23893 will become 0:24 - you can configure this so that it can output whatever format works for you.
Keyboard Maestro Script

The Javascript that I used for the calculations:
var app = Application.currentApplication()
app.includeStandardAdditions = true
var kmInst = app.systemAttribute("KMINSTANCE");
var kmeApp = Application("Keyboard Maestro Engine")
var myLocalVar = kmeApp.getvariable("Local__MyVar", {instance: kmInst});
kmeApp.setvariable("Local__FromJXA", {instance: kmInst, to: "Set in JXA Script"})
function millisToMinutesAndSeconds(millis) {
var minutes = Math.floor(millis / 60000);
var seconds = ((millis % 60000) / 1000).toFixed(0);
return minutes + ":" + (seconds < 10 ? '0' : '') + seconds;
}
millisToMinutesAndSeconds(myLocalVar); // "4:59"