Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Counting columns with greps and auto change paragraph or character syle

New Here ,
Oct 31, 2022 Oct 31, 2022

I'm looking for a way to use Greps in my calendar building.  I would like to create a style sheet that applies one paragraph style to entire chain of text 5 boxes that have 7 colomns each, but change the character style of the 1st and 7th colomn of a text boxes to a different character or paragraph style.  Can anyone help me figure out how to do this using greps inside a paragraph style? 

TOPICS
How to , Type
842
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 2 Correct answers

Community Expert , Oct 31, 2022 Oct 31, 2022

You can do this with a table - which is my preferred way to make a calendar

 

First auto number a paragraph style and apply a blank return in each cell

EugeneTyson_0-1667281262871.png

 

 

Select the Cell 

Copy

And paste to all the other cells

 

EugeneTyson_2-1667281350607.png

 

Delete text from extra cells

EugeneTyson_3-1667281370332.png

 

 

Create a new paragraph style

EugeneTyson_4-1667281436460.png

 

 

Go to 

EugeneTyson_5-1667281500328.png

 

 

EugeneTyson_6-1667281520751.png

 

 

Go to Table Styles

EugeneTyson_7-1667281540219.png

 

 

EugeneTyson_8-1667281559244.png

 

 

 

Apply the Style - ooooops

EugeneTyson_9-1667281590689.png

 

 

EugeneTyson_10-1667281616799.png

 

EugeneTyson_11-1667281638506.png

 

 

Add/Remove paragraph returns to get the start end dates of each month

 

EugeneTyson_12-1667281694253.png

 

 

Add the Cell Styles for the RIGHT too - you can the

...
Translate
LEGEND , Nov 01, 2022 Nov 01, 2022

Not a GREP 😉 but my idea was pretty close 😉

 

Instead of TABs - you need to use Forced Line Breaks - Shift+Enter - and instead of GREP - use Nested Styles option - then set your ParaStyle like this - there is no option to show more NestedStyles - you just need to repeat them 😉

 

AdobeScripts_0-1667328430166.png

 

5, 1, 1, 5, 1, 1, ...

 

AdobeScripts_3-1667329104039.png

 

And you need separate TextFrames for each day:

 

AdobeScripts_0-1667330416122.png

 

The only drawback - you need to manually RE-APPLY this ParaStyle after you add/remove leading FLBs - InDesign won't update NestedStyles automatically

...
Translate
LEGEND ,
Oct 31, 2022 Oct 31, 2022

If each month would always start on monday - then you could try and count the tabs - but as each month starts on a different day - you would need to create 12 ParaStyles each year. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 01, 2022 Nov 01, 2022

Acutally it shouldn't matter as every text box must have a column return in each empty field to cause the text to move to the next column to make the month start on a different day, so even though the month starts on a monday or friday, there is a colomn return in the empty columns for the grep to count. 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 01, 2022 Nov 01, 2022

Let me correct myself.... every column must have a column return in each empty field ....

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 01, 2022 Nov 01, 2022

It can't count it though - GREP is a General REGULAR Experession Parser

 

Your document might have 7 column breaks - but they are not in a regular pattern.

First box is a column break - 2nd box (date 1) is a Number (paragraph return) - text - column break

next is a Number Column break.

 

There's nothing regular about the expression you're searching for - in my opinion and I could be (and have been before) completely wrong. 

 

But I don't there's a way to ask GREP to find the first and last of each side of the columns. 

 

The only way I know for certain works is the Table method.

 

 

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 01, 2022 Nov 01, 2022

That's too bad, I was hoping it could just ignore the other stuff and just count the hard returns and column returns... 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 01, 2022 Nov 01, 2022

I'll keep working on it and see if I can muster a solution. 

 

I am personally exhausted today. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 31, 2022 Oct 31, 2022

You can do this with a table - which is my preferred way to make a calendar

 

First auto number a paragraph style and apply a blank return in each cell

EugeneTyson_0-1667281262871.png

 

 

Select the Cell 

Copy

And paste to all the other cells

 

EugeneTyson_2-1667281350607.png

 

Delete text from extra cells

EugeneTyson_3-1667281370332.png

 

 

Create a new paragraph style

EugeneTyson_4-1667281436460.png

 

 

Go to 

EugeneTyson_5-1667281500328.png

 

 

EugeneTyson_6-1667281520751.png

 

 

Go to Table Styles

EugeneTyson_7-1667281540219.png

 

 

EugeneTyson_8-1667281559244.png

 

 

 

Apply the Style - ooooops

EugeneTyson_9-1667281590689.png

 

 

EugeneTyson_10-1667281616799.png

 

EugeneTyson_11-1667281638506.png

 

 

Add/Remove paragraph returns to get the start end dates of each month

 

EugeneTyson_12-1667281694253.png

 

 

Add the Cell Styles for the RIGHT too - you can then apply that CELL STYLE to the RIGHT hand side of the table too

 

EugeneTyson_13-1667281781039.png

 

EugeneTyson_14-1667281911572.png

 

EugeneTyson_15-1667281920718.png

 

 

EugeneTyson_16-1667281998051.png

 

Order of creation

Paragraph Styles

Cell Styles

Table Style

 

So your Paragraph Styles look like this

EugeneTyson_17-1667282162578.png

 

Your Cell Styles

EugeneTyson_18-1667282174679.png

 

Table Style

EugeneTyson_19-1667282185056.png

 

 

Then your Table Style similar to this

EugeneTyson_20-1667282206339.png

 

 

 

 

You can then go about creating Header Rows

Footers - and style it much better

 

 

Here's an example file for you

https://www.dropbox.com/s/mq685285e2sog8l/Untitled-5.idml?dl=0

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 01, 2022 Nov 01, 2022

Thanks Eugene, but I find that using tables for building calendars creates extra challenges from year to year having to rework each month too much.  Using chained text boxes with 7 colomns in each allows for simple and quick movement of the days of the week each year without having to alter the number of days each month and I can have 'most' special days move easily with the text. 

 

I need a grep that will apply a character style initially, then stop applying after the first hard return or colomn break, count 6 colomn breaks, apply the character style again till it see's a hard return or colomn break, then stop applying it again,  and then start over.   This should then allow for any other type to be ignored for holiday naming and count out a full week.  See the attached example with the style sheets set up but needing the grep to finish the job... it also explains how this setup for calendars really works easily.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 01, 2022 Nov 01, 2022
quote

Thanks Eugene, but I find that using tables for building calendars creates extra challenges from year to year having to rework each month too much. 


By @Priority Printing-1

 

When you use Auto Numbering you only have to enter the start and the end of each month. It takes seconds and there is no need to manually check. 

 

I don't know of a GREP that will do this - and I think it's too much for a GREP to work with as already mentioned by another very experienced user. 

 

I strongly urge you to consider the Table Option.

It's very simple to update for the following year and takes only moments.

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 01, 2022 Nov 01, 2022

Eugen, can you show me how you can have holidays or birthdays (special days) entered into the same date with a different style applied to the name of the holiday and birthdays and then explain how to move them from year to year without having to re enter them?

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 01, 2022 Nov 01, 2022

Yes I can

But not at the moment. 

 

Moving the dates is the easy part. 

Styling them is the hard part. 

 

I've done calendars like this for about 15 years. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 01, 2022 Nov 01, 2022

Thanks Eugen....    I'm always open to find a better way of doing things.  I've developed my style of doing calendars over the past 20+ years and have found it most effective to date. But would love to find a better way, especially if it fixes the one last thing I can't find a solution for.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 01, 2022 Nov 01, 2022

Not a GREP 😉 but my idea was pretty close 😉

 

Instead of TABs - you need to use Forced Line Breaks - Shift+Enter - and instead of GREP - use Nested Styles option - then set your ParaStyle like this - there is no option to show more NestedStyles - you just need to repeat them 😉

 

AdobeScripts_0-1667328430166.png

 

5, 1, 1, 5, 1, 1, ...

 

AdobeScripts_3-1667329104039.png

 

And you need separate TextFrames for each day:

 

AdobeScripts_0-1667330416122.png

 

The only drawback - you need to manually RE-APPLY this ParaStyle after you add/remove leading FLBs - InDesign won't update NestedStyles automatically ... bug ?

 

Attached IDML - can't attach much smaller IDML so there is much larger INDD instead 😞 - file have everything set up - including ObjectStyles applied to the TextFrames 😉

 

I've even found solution for special days 😉 hint - 16th 😉 ... AnchoredObject 😉

 

Or I can revive script I've created looong time ago that was preparing TaggedText with all the bells and whistles 😉

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 01, 2022 Nov 01, 2022

I was looking at nested styles too.

 

Well done. I got stuck at the style switching over frames. At this point I was nodding off and falling asleep at the keyboard so I gave up 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 03, 2022 Nov 03, 2022

Robert, thanks for this.  I've played with it a little and it does and doesn't work but it's probably more me not familiar with how it works completely yet, i understand the basics but can't seem to massage it into how i build calendars yet. 

 

your right about the bug, that is a problem

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 03, 2022 Nov 03, 2022

 

 

I've spent much of the day watching online videos of people making calendars... usually using tables.  Which is where i started too, but because i've worked primarily in a production environment for years, I've wanted a quick and easy way to move last years calendar into the current year.  I'll admid the creation of calendars using columns is quick and easy, but what I don't see anyone doing in these tutorials is adding Holidays or special days to the calendar!  and if they are they are doing it on secondary layers, which have to be dealt with seperately.   And then secondly what happens next year... how easy is it to move all the dates to the new days of the week without rebuilding or having to redo the holidays and special days that were added to each day!         

 

That is why I have moved to using linked text boxes with 7 columns in each and using column returns to move the dates from one column to the next.  I also use paragraph styles to apply the date styles and then other for holiday type, holiday date highlighting etc.  Then when next year rolls around all i have to do is add or subtract column returns from the front of the first row to adjust the new year!  Fast and holidays and special dates like birthdays move with the dates.  Yes there are a few holidays i have to manually go change, but that's only a few.   

 

I'd love to know how people are adjusting a previous years calendar using tables without having to totally redo holidays and special added days and bump days forward or backwards.... my way allows for it very easily, but of course I'm used to it.....

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 03, 2022 Nov 03, 2022

Not sure if you've noticed - but my example already takes care of the extra dates - anchored TextFrame for the 16th.

 

But I've just realised that it will require manual update if this extra day will be on Saturday or Sunday...

 

People doing calendars as tables either do them manually from scratch each year 😉 or use generators. I've created one years ago 😉

The output was Tagged Text.

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 03, 2022 Nov 03, 2022
LATEST
quote

I've wanted a quick and easy way to move last years calendar into the current year.  I'll admid the creation of calendars using columns is quick and easy, but what I don't see anyone doing in these tutorials is adding Holidays or special days to the calendar!  and if they are they are doing it on secondary layers, which have to be dealt with seperately. 

By @Priority Printing-1

 

I agree that automation is a fantastic idea - but there's so many permutations with calendars.

I've been doing them so long that you realise calendars repeat every few years. 

It's every 5/6/11 years
Although 2022 won’t repeat again until 2033.

 

https://www.timeanddate.com/calendar/repeating.html

 

There's no 'automatic way' - I feel. 

And lets face it - it's 12 calendar pages - and it's relatively quick.

I prefer tables with automatic numbering in the cells as it's the quickest way to get from 1-31 in sequence and then start on the day - end on the day - and all the numbers in between are automated. 

 

I almost got burned before with threaded text frames - where the previous designer moved the text thread into a different position - and when the dates up dated - one date jumped to the wrong position.

Luckily caught it.

 

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines