Copy link to clipboard
Copied
Hi there,
I'm a magazine designer, and I've just moved from a company where we had CMS and the month and year in the folios were automatically updated. I've moved to a smaller company and am hoping I can set up the same system, so we don't have to edit the month every time. I've found the way to create the current month Text Variables>Define>New>Type: Modification date but I'm looking for ways to forward date it by a month.
The code we used where I used to work was <%+1m><%M> <%Y> which would give us the next month and year. (i.e.. December 2016)
(Using CS4 and CMS)
And now all I can get is the current month with MMMM yyy (ie. November 2016)
(Using CC and no CMS)
Is there the capability to achieve this in InDesign alone?
Any help would be great
Thanks,
Flo
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Not sure where you're looking but this is what I'm seeing...
Copy link to clipboard
Copied
dps_advancedphotographer@ wrote:
Not sure where you're looking...
The link Loic posted will allow you to download a script that adds the "Next Month" functionality to your Text Variables menu.
Copy link to clipboard
Copied
Hi.
I used your script and it was very helpful. But I have another problem. Since I am using my own language and not English, need to use our names of the months. That wasn't a problem to change. Problem is that I need two different lists. I think that in English cause there is called Noun Case. What I basically need is two lists (names of the months)
List 1:
Siječanj
Veljača
Ožujak
Travanj
Svibanj
Lipanj
Srpanj
Listopad
Studeni
Prosinac
List 2:
Siječnja
Veljače
Ožujka
Travnja
Svibnja
Lipnja
Srpnja
Listopada
Studenog
Prosinca
I would like to have both those lists in one same script. Can you help me with that?
Copy link to clipboard
Copied
Yes, English doesn't have this context when referring to months, but other languages like Polish do.
Before the close curly brace i.e. } on line 76, declare another variable but with a different name for the getNextMonth function, e.g. getNextMonthInContext
//Adding next month in context to text variables | |
createTextVariable(doc, "Next Month in Context", getNextMonthInContext(), true ); |
Then make another function that is the same as the current getNextMonth() function (lines 78-95) but call it getNextMonthInContext() and change the months to be the months with the context in question.
Copy link to clipboard
Copied
So it should look like this (from the line 75 to the 115)?
//Adding next month in context to text variables
createTextVariable(doc, "Next Month in Context", getNextMonthInContext(), true );
}
function getNextMonth() {
var date = new Date();
var month = date.getMonth();
var Months = ["SIJEČANJ",
"VELJAČA",
"OŽUJAK",
"TRAVANJ",
"SVIBANJ",
"LIPANJ",
"SRPANJ",
"KOLOVOZ",
"RUJAN",
"LISTOPAD",
"STUDENI",
"PROSINAC"];
return Months[month+1];
}
function getNextMonthinContext() {
var date = new Date();
var month = date.getMonth();
var Months = ["SIJEČNJA",
"VELJAČE",
"OŽUJKA",
"TRAVNJA",
"SVIBNJA",
"LIPNJA",
"SRPNJA",
"KOLOVOZA",
"RUJNA",
"LISTOPADA",
"STUDENOG",
"PROSINCA"];
return Months;
}
Copy link to clipboard
Copied
return Months[month+1];
Copy link to clipboard
Copied
Should have say it's a startup script
Copy link to clipboard
Copied
Can I edit this Java script? It uses English language and I need local for month variable. I'm new to this scripting business.
Copy link to clipboard
Copied
Yes. Open the jsx file in a TEXT EDITOR (i.e. notepad, textedit, textwrangler... NOT WORD) and look for the line that begins with "function getNextMonth() {". In this function, you will see the months written in English... change them to whatever locale your language is.