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

GREP style problem

Explorer ,
Jun 13, 2019 Jun 13, 2019

Copy link to clipboard

Copied

Hi,

I'm new to GREP styles so bear with me if I ask stupid questions

I'm trying to make some GREP styles for a large document, and two of them worked fine. Now I want to make a GREP style which applies a certain Character style to every caption with images or tables. They all start with either "Figure x." or "Table x.", where x is a digit. After that, a small text with the title or caption of the thing follows.

I made the following GREP style, but it is not working:

^(Figure|Table)[ ][\d][\.][ ]+.+

The weird thing is, if I put this expression in the Find/Change GREP query, it does work because it finds all the right texts. If I apply it to my Paragraph Style however, it does not work.

What am I doing wrong?

Thanks so much in advance!

Views

1.5K

Translate

Translate

Report

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

Mentor , Jun 13, 2019 Jun 13, 2019

It must.

Something wrong on your side.

Which version of InDesign? If 14.02, did you apply the patch regarding GREP?

Also show as a screenshot with your *non-working* text, with hidden (non-printable) characters visible.

Votes

Translate

Translate
Mentor ,
Jun 13, 2019 Jun 13, 2019

Copy link to clipboard

Copied

This should do the trick:

^(Figure|Table)\x{20}\d+\.\x{20}.+

Edit:

this one also will work:

^(Figure|Table)[\x{20}\d\.]+.+

That said, there may be more slightly different versions.

Votes

Translate

Translate

Report

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 ,
Jun 13, 2019 Jun 13, 2019

Copy link to clipboard

Copied

Thanks for your response!

Unfortunately, it didn't do the trick...

Votes

Translate

Translate

Report

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
Mentor ,
Jun 13, 2019 Jun 13, 2019

Copy link to clipboard

Copied

It must.

Something wrong on your side.

Which version of InDesign? If 14.02, did you apply the patch regarding GREP?

Also show as a screenshot with your *non-working* text, with hidden (non-printable) characters visible.

Votes

Translate

Translate

Report

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 ,
Jun 13, 2019 Jun 13, 2019

Copy link to clipboard

Copied

Ah, since I literally found out about GREP styles 2 hours ago I didn't know there was a patch for version 14.0.2.

It is working now (also my own GREP style yay) after installing the patch!

Thanks for the help

Votes

Translate

Translate

Report

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
Mentor ,
Jun 13, 2019 Jun 13, 2019

Copy link to clipboard

Copied

Nice, you're welcome

Votes

Translate

Translate

Report

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 ,
Jun 13, 2019 Jun 13, 2019

Copy link to clipboard

Copied

winterm and all,

Here is an small question: after you have applied the hot patch to InDesign, how do you know it has been done already? Does it signify this anywhere?

For example, I move among many installs of InDesign and forget which one I patched.

Mike in Maryland

Mike Witherell

Votes

Translate

Translate

Report

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
Mentor ,
Jun 13, 2019 Jun 13, 2019

Copy link to clipboard

Copied

Hi Mike,

In your InDesign installation folder, Required subfolder, there must be TextWalker.rpln plugin. Check its creation date. If it is different (newer) then neighboring files, your ID is patched. Not an elegant solution, I know 

BTW, another thing that bothers me is InDesign installation path in that vbs Adobe provides. It is hard coded to Program Files. What if one installed Indesign, say, in C:\Adobe\InDesign? Like I do from the beginning of times? Solution: open CopyPlugin.vbs in plain text editor and change %PROGRAMFILES% to %systemdrive% (two times, for 32-bit and 64-bit versions, letter case doesn't matter).

Votes

Translate

Translate

Report

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 ,
Jun 13, 2019 Jun 13, 2019

Copy link to clipboard

Copied

winterm  wrote

…What if one installed Indesign, say, in C:\Adobe\InDesign? Like I do from the beginning of times? Solution: open CopyPlugin.vbs in plain text editor and change %PROGRAMFILES% to %systemdrive% (two times, for 32-bit and 64-bit versions, letter case doesn't matter).

Hi winterm ,

similar scenario on my side:

I had installed InDesign CC 2019 14.0.2 on drive F: and the vbs script found no way to reach it.

So I did three things:

1. Quit InDesign CC 2019

2. Did a backup of the old TextWalker.rpln file in my application folder on drive F:. Adobe InDesign CC 2019 > Required

3. Removed the old TextWalker.rpln file and moved the new TextWalker.rpln file from the CopyPlugin.zip > CopyPlugin > win64 folder to the Required folder.

Restarted InDesign and tested a GREP pattern that failed before successfully.

Note: I'm on Windows 10.

Regards,
Uwe

PS: Thanks to Peter Kahrel who gave me the hint.

Votes

Translate

Translate

Report

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
Mentor ,
Jun 13, 2019 Jun 13, 2019

Copy link to clipboard

Copied

LATEST

Hi, Uwe,

sure, since all that script does is updating TextWalker.rpln file, it's easy to perform manually. I bothered to modify the code of vbs just to keep original UI of the whole process.

Votes

Translate

Translate

Report

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
Mentor ,
Jun 13, 2019 Jun 13, 2019

Copy link to clipboard

Copied

BTW, there’s nothing really wrong with your original regex, unless the number of your Figure/Table is always just one digit.

If not, just add a plus sign after digit inclusion group:

^(Figure|Table)[ ][\d]+[\.][ ]+.+

Since there’s absolutely no point to create separate inclusion group for each character, feel free to include all them in the same group, using unicode notation for a space (safer). That’s from where my second regex (in post 1) comes:

^(Figure|Table)[\x{20}\d\.]+.+

Votes

Translate

Translate

Report

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