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

Script or Paragraph Style?

Explorer ,
Jul 20, 2016 Jul 20, 2016

I have an Excel Spreadsheet with Business Name, Phone, and Category.

Admittedly - I'm an InDesign noob - but I am picking things up quickly.

I want to format this info (over 600 entries) into an almost "phone book" like layout.

3 columns, Bold first line, tabs: with dotted Leader, regular typeface font phone number, next line category: italic.

Link so:

This Business Name ......... (555) 555-5555

Financial Services

I also need to adjust spacing between each (space after paragraph), kerning between Business Name and beginning of "..." (and after).

Paragraph Style isn't doing it....it's styling the whole entry as the first line.

Do I need to build a script?

Thank  you to anyone who takes the time to add some insight.

-Josh

TOPICS
Scripting
2.6K
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 1 Correct answer

Guru , Jul 24, 2016 Jul 24, 2016

Here's a little screen-cast.

There's a small goof that the change grep should have be done before the change text.

Translate
Guide ,
Jul 21, 2016 Jul 21, 2016
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
Guru ,
Jul 21, 2016 Jul 21, 2016

Might be easier to just import the the table.

Screen Shot 2016-07-21 at 16.21.48.png

Convert to text.

And apply a simple nested paragraph style to it

Screen Shot 2016-07-21 at 16.41.18.png


Find Grep

(\t)([^\t]+)$

Change to

\n$2

Screen Shot 2016-07-21 at 16.46.22.png

Fake the kerning, play around with different types of spaces.

^< is a thin space

Find Text

^t

Change to

^<^t^<

Screen Shot 2016-07-21 at 16.50.52.png

Shouldn't take more than 5 to 10 minutes.

HTH

Trevor

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
Enthusiast ,
Jul 21, 2016 Jul 21, 2016

I would vote for Trevors version .

Instead of importing the table and converting to tab text, you could import tab text directly by choosing this option at the import options dialog.

Another GREP, but not better as Trevors:

Find what: \t(?=[^\t]+$)

Change to: \n

Then use a nested style or a grep style:

Bildschirmfoto 2016-07-21 um 21.48.35.png

I would control the dotted line not with the tabs option. Instead I recommend a character style. Here you have more control about thickness, spacing …. Realize that you get in this case dancing dots. If you want to avoid this, use the tabs option for the dotted line and apply a character style later.

Bildschirmfoto 2016-07-21 um 21.55.49.png

Whatever you are doing: Don’t use more than one paragraph style!

best

Kai

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
Guru ,
Jul 21, 2016 Jul 21, 2016

Hi Kai

Nice one! Maybe we can turn this thread into a Scripting / InDesign service catalog, see who joins in

I think your grep is better.

Reagards

Trevor

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 ,
Jul 21, 2016 Jul 21, 2016

Hi,

Not really sure we need Grep [Grep Find/Replace and Grep styles]!

Just import the text! 

Capture d’écran 2016-07-21 à 22.31.07.png

Capture d’écran 2016-07-21 à 22.35.50.png

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
Enthusiast ,
Jul 21, 2016 Jul 21, 2016

Michel, since the names and the numbers could have a different length, this is surely not a good idea.

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 ,
Jul 21, 2016 Jul 21, 2016

Hi Kai,

It depends on how you define your [only one] tabulation!

Capture d’écran 2016-07-22 à 06.11.17.png

Note that in a big part of the Known Universe, especially on the External Border, visio-space connection numbers are very long!

For other V.I.P, … very short! 

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
Guru ,
Jul 22, 2016 Jul 22, 2016

No form of kerning offered in his answer.

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
Enthusiast ,
Jul 22, 2016 Jul 22, 2016

If it works it works, but the second tab is pretty useless in this case and should removed. So if someone cries for a second line, give him a real second line. And yes: The kerning must also be honored.

Anyway: Interesting to see, how different a simple task is solved. Hopefully the OP find our answers helpful.

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 ,
Jul 22, 2016 Jul 22, 2016

Hi Trevor,

No need kerning too!

Capture d’écran 2016-07-22 à 11.31.10.png

… Kai is right! What is really interesting is that there're difference ways to answer! 

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
Guru ,
Jul 22, 2016 Jul 22, 2016

Yep his right, there the correct answers and the incorrect ones.

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
Enthusiast ,
Jul 22, 2016 Jul 22, 2016

Trevor, Michel wants to have always the last word 😉 But to make things clear: Michel you are wrong.

We are talking not about the space between dots. We are talking about the space before and after the dots.

Sadly the space before could simply archived with a character style applied on the character before the tab, e.g. ".(?=\t)". That’s why I try to avoid this second tab. But if you apply tracking to the tab, this has no impacts to the space after the tab.

So Trevors solution, e.g. insert thin space is the only way to get the right result.

Think, we should close this thread right now, since the OP seems not to have a real interest in solving his problems.

Kai

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 ,
Jul 22, 2016 Jul 22, 2016

Kai,

I never want to have the last word!    I only want to finish a topic point "plutôt que de rester au milieu du gué", as we say in France!

So, yes! I just forgot the approach before/after the first tab! To include it, we could use a grep style [no need to add thin spaces]!

Capture d’écran 2016-07-22 à 12.17.42.png

Of course, this approach influences the space between the dots! … "Mais ne soyons pas plus royalistes que le Roi!" 

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
Explorer ,
Jul 26, 2016 Jul 26, 2016

Kai,

Your GREP helped a lot with this. Thank you so much for taking the time to help.

I am trying to keep notes and I was wondering what your GREP "decodes" to?

Find Grep

(\t)([^\t]+)$

Change to

\n$2

It's brilliant because I think it tells GREP to "skip" the first tab, and go to the second tab, and change that second tab to a hard-break?

-Josh

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
Engaged ,
Jul 26, 2016 Jul 26, 2016
LATEST

Find GREP:

\t     tells GREP to find a tab.

[^\t]+$     tells GREP to find anything that isn't a tab up to an end of a paragraph

The parenthesis around (\t) and ([^\t]+) Tell GREP to set those items to found strings.

Change to:

\n     Tells grep to add a forced line break

$2     Tell GREP to place the second found string

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
Engaged ,
Jul 21, 2016 Jul 21, 2016

I would suggest using two paragraph styles and a character style. Set the character style to how you want the business name to appear. Then set the first paragraph style to how you want the phone number to appear (including the leader dots on the tab.) with the next style set to the second paragraph style. In the first paragraph style set the character style you created as a nested style up to 1 tab character. The second paragraph style should be set to how you want the business details with the next style set to the first paragraph style. In the second paragraph style, you can set the space after to whatever you'd like the spacing to be between each company. Make sure that, in both paragraph styles, the "Based on:" field is set to none or any changes you make to one style will affect the other style.

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
Explorer ,
Jul 22, 2016 Jul 22, 2016

Thank you very much.

I'm getting confused because every tutorial is always using images - my layout is much different.

It's basically just like a phone book, really.

I'm sure that once I spend more and more time and finally understand this, I'll look back at your step-by-steps and they will make more sense to me but I'm lost...

I'm a Lynda member and even their demonstrations on Datamerge alway talk about business cards, or mailer, and always talk about images.

When i follow the instructions datamerge won't let me click on "Record per Document page" - and therefore it wont let me do anything in the multiple records menu...

And when I just  click "ok" it merges and merges and merges and just opens up multiple versions of the InDesign doc.

I would LOVE to get the hang of the datamerge idea - it seems like exactly what I need.

GREP seems awesome too but how do I layout the over 600 entries, and GREP from there?

If any of you have the heart to read all this and still help me - thank you thank you thank you.

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
Enthusiast ,
Jul 22, 2016 Jul 22, 2016

Josh, whatever you do, it will take you not longer as us, to write that all up 😉

Even if you use datamerge, there must be a kind of formatting. Believe us, datamerge isn’t neccecary.

So, load up for all a excel-file and a indesign file, that shows your final result as a example and someone built you a demofile or better: Sent me your complete data.

Since we have determined the way, it takes just two minutes to go the way. I will investigate those 2 minutes so that we than have all weekend.

Kai

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
Guru ,
Jul 24, 2016 Jul 24, 2016

Here's a little screen-cast.

There's a small goof that the change grep should have be done before the change 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
Guru ,
Jul 24, 2016 Jul 24, 2016

You should click on the full screen button on the video player to see what's going on.

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
Explorer ,
Jul 25, 2016 Jul 25, 2016

Wow - thank you so much, Trevor.

Seriously...thank you.

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
Explorer ,
Jul 25, 2016 Jul 25, 2016

*** and thank you also to everyone here - I hope one day to return the favor.

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
Guru ,
Jul 25, 2016 Jul 25, 2016

Pleasure, please return the favor by marking my answer as correct.

You have to click on correct and not just like

Thanks

Trevor

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
Contributor ,
Jul 24, 2016 Jul 24, 2016

Hi,

Try to use Excel Schema to change Excel file to xml.

see this link:

Creating an XML file from Excel 2007 - YouTube

and make your sample with tags in Indesign file.

the tag name need to same as the xml tags

like

<head></head>

<title></title>

ext.

and then import the xml file, the the excel text will automatically formated as your sample.

regard

good

John

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