You should be able to do this with this library (there may be others around too). The repo has some usage examples for various things.
Some basic examples:
// This one should allow to use existing documents in JS.
const result = await document.getSelectedDocument();
console.log(result);
const doc = new Document({ name: 'Test 123', theme: 'Test Theme' });
const docSlides = await doc.getSlides();
docSlides[0].setTitle('Welcome to Slide 1!', { fontSize: 90 });
You can easily add a date to this title string and format it to your liking. How to add some amount of minutes to a date is addressed in this SO question.
It doesn't mention any additional setup, beyond running it with NodeJS (node my-script.js
). The application detects the currently active Keynote window by itself.
Perhaps it needs some kind of OS permission, but I can't test it as I'm currently not on an Apple device.
You can just copy and adapt their example scripts as a starting point, and you should be able to get it working.