How to Translate Numerical Values for a Macro's `CreationDate` and `ModificationDate`?

If you use JXA to get the macro from the Keyboard Maestro engine, it will return creationDate as a JavaScript Date object:

const kmEditor = Application("Keyboard Maestro");
const uuid = "1C7E9AF3-12CD-40A3-9A39-068A82287A2C";

const result = kmEditor.macros.whose({id: {"=": uuid}});
if (result.length === 0)
	throw new Error(`Macro ${uuid} not found`);
const creationDate = result[0].creationDate()
console.log(`creationDate: ${creationDate}`);

I'm not sure of your use case, so I'll leave it at this.

1 Like