I can do it by inserting an anchored text frame that is linked to an external file or a Content Grabber source.
But the results may not be what you want as the date doesn't break across the lines of body text.
So it depends on your layout.
Show an example of the various layouts and I'll let you know if my technique would work. And then how to do it.
Wow, thanks for your kind offer Sandee,
I´ll attach two screen shots to show my layouts.
This is (last year´s) table layout with 200+ single dates, each date having it´s own cell:
And this is another instance of date inside a normal text frame:
My idea is to just write down the proper date like DD.MM.YYYY and let ID convert it into the format needed: in the table only into "SA 20", inside the text frame to "Samstag, 12. November 2016", mainly so the week day is added automatically.
Did I get that right: with your solution I would have to provide an additional file with the correct dates for ID to look after?
Curios to see if your idea is applicable
2 people found this helpful
This is very scriptable, but there's nothing built-in InDesign to do it.
For instance, this 1-line script will allow you to type in a date (in many formats, though not separated by periods [12.5.87 won't work]; try using slashes [12/5/87]). It will display the date in your local machines current formatting (so if that is set to show the day of the week, you will see that).
A lot of customization is possible for the output, of course. And it's not a large step from here to looping through all dates in your document and substituting the correct day...
Then it would be the last step before going to print, right? Because it would replace any string that matches [M/D/YY]? Dates would not be handled like cross-references/hyperlinks inside the document, that update themselves whenever a page moves?
Would that script replace every string inside the document with the same output format that is defined through how i set up my computer? Say, in my example I have the table output, which should differ from the output in regular text frames. Both have different paragraph styles – could that be addressed?
1 person found this helpful
"Then it would be the last step before going to print, right? Because it would replace any string that matches [M/D/YY]?"
I guess so.
"Dates would not be handled like cross-references/hyperlinks inside the document, that update themselves whenever a page moves?"
No. But this makes it sound like you're looking for something different. You could set up perhaps, a running header with the name of the day, on each page. Then, when you move an event to a different page, the day would get picked up by the running-header variable. It depends exactly what you're after.
"Would that script replace every string inside the document with the same output format that is defined through how i set up my computer? Say, in my example I have the table output, which should differ from the output in regular text frames. Both have different paragraph styles – could that be addressed?"
Anything is possible. It depends what you would want.
I can't offer to write a complete script here for free, but you could (a) ask in the scripting forum -- there are some people there who are getting their feet wet and might be interested in taking this on as a challenge; or (b) contact me through a private message for a quote; or (c) best option: take the plunge yourself and try and put something together in the scripting department (it's not as hard as it looks!) :-)
1 person found this helpful
date = new Date(app.selection.contents) datestr = ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Dienstag", "Freitag", "Samstag"][date.getDay()] datestr += ', ' datestr += ["Jan", "Feb", "Mär", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez"][date.getMonth()] datestr += ' '+ date.getDate()+', '+date.getFullYear() alert(datestr); app.selection.contents = datestr
(You can safely remove the 'alert' line, so it will immediately effect the selected text.)
(Edit: huh - the image uses 'getYear', which returns the year from 1900 on, and hence the "117". So, better use "getFullYear" there. I changed it in the script.)
the cross-reference comparison was more about pointing out my idea of having the date handled like a variable throughout the whole process. So, if the date receives an update, the output would automatically generate the new week day. But I understand, that´s not possible.
I will definitely look into scripting that thing!
Holy! That´s gold! Thank you Jongware!
This is what comes closest to what I am looking for. This way, at least I can validate every date the moment I insert the text into the document.
I´ll take that as a starting point and see how I can make ID output the information that I need. I assume I´m going to use a different script for every kind of display. I´ll dig deep
Thanks a lot!
1 person found this helpful
Tuesday has the same name as Thursday in German?
Actually no, it would have to be "Dienstag" for "Tuesday" and "Donnerstag" for "Thursday".
I wasn't sure I could write out the correct Namen for all the Tagen from memory, so I looked it up on the interwebz. After all, it's only one quick copy-and-paste ...
It goes to show, you cannot believe anything you find on the net
You think it´s worth it to make this a full feature request?
I cannot imagine it would be in anyone´s interest to have a wrong week day next to a date. Maybe a general approach in terms of having a date put down like a place holder/variable, i.e. through a date picker, and then defining the actual output through character/paragraph/GREP style would come in handy, not only to myself, but also others? (Word offers to display the current date in different formats?)