Copy link to clipboard
Copied
Using InD 15.1.3, my client likes the date to be part of the file name and he likes it in a specific format: 06.09.21
Is there a way to program a shortcut key that will insert the current date in that format when naming/saving a file in InDesign? I do this 100 times a day.
Thank you!
HI,
Try following snippet to save the file that will append the date in the end.
var dateObj = new Date();
var year = dateObj.getFullYear().toString().substr(-2);
var month = ("0" + (dateObj.getMonth() + 1)).slice(-2);
var date = ("0" + dateObj.getDate()).slice(-2);
var _formattedDate = month + "." + date + "." + year;
var fileName = "Test_" + _formattedDate + ".indd";
var file = app.activeDocument.save(File(Folder.desktop + "/" + fileName));
Copy link to clipboard
Copied
HI,
Try following snippet to save the file that will append the date in the end.
var dateObj = new Date();
var year = dateObj.getFullYear().toString().substr(-2);
var month = ("0" + (dateObj.getMonth() + 1)).slice(-2);
var date = ("0" + dateObj.getDate()).slice(-2);
var _formattedDate = month + "." + date + "." + year;
var fileName = "Test_" + _formattedDate + ".indd";
var file = app.activeDocument.save(File(Folder.desktop + "/" + fileName));
Copy link to clipboard
Copied
Hi! I'd like to try this but I don't know where to put the script once I've compiled it in Script Editor so that it is active when I go to save a file. What folder does it belong in?
Copy link to clipboard
Copied