Copy link to clipboard
Copied
Hello. Does anyoe know a way to put the text variables 1 year in advance. So everyday I open indesign, the date has changed with a +1 year. 07-JUN-2025
Copy link to clipboard
Copied
Make a custom text variable called "oneyeardate". Then, run this script when you open the doc:
var d = new Date();
var day = ("0" + d.getDate()).slice(0,2);
var month = ("0" + d.getMonth() + 1).slice(0,2);
var nextyear = d.setFullYear(d.getFullYear() + 1);
app.activeDocument.textVariables.itemByName("oneyeardate").customTextVariablePreferences.contents = month + "-" + day + "-" + nextyear;
Copy link to clipboard
Copied
For customTextVariablePreferences use variableOptions instead.