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

How can I apply a GREP style to a text variable?

Community Beginner ,
Oct 15, 2014 Oct 15, 2014

Copy link to clipboard

Copied

Hello everybody,

I have a question concerning GREP styles inside Paragraph styles.

1. I've created a text variable to generate a recurring title on the upper side of the page based on the main title paragraph style;

2. The recurring title is in Adobe Garamond Small Caps, all letters in lower case, and it is formatted with a paragraph style sheet in the master page;

3. I want to create a GREP style for the recurring title, according to which every time that in the recurring title appear an apostrophe or the double quotes, they are automatically lowered 2pt on the baseline

(I already created the character style sheet that lowers letters of 2pt).

What I need is the correct GREP formula to automatically apply the character style sheet to apostrophes and double quotes, in the line of text generated by the text variable...

Thanks for your  help

p.

TOPICS
Scripting

Views

3.2K

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 ,
Oct 15, 2014 Oct 15, 2014

Copy link to clipboard

Copied

Text variables do not "generate" a line of text, so this cannot be done with text variables. You have to convert them to plain text first.

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 Beginner ,
Oct 15, 2014 Oct 15, 2014

Copy link to clipboard

Copied

Hello Jongware,

so how do I convert them to plain text? is it possible to do it automatically?

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 ,
Oct 16, 2014 Oct 16, 2014

Copy link to clipboard

Copied

When I need to convert variable to plain text, I like to use the «tomaxxiVARIprocessor» script. You can find it here: Downloads | tomaxxi.com | All about Adobe Creative Suite

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
LEGEND ,
Oct 17, 2014 Oct 17, 2014

Copy link to clipboard

Copied

Hi,

I think it's time to take a look to Power Headers, a very (very very) clever tool written by Harbs, of in-tools.com! 

No other comment!

Power Headers | in-tools.com

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 Beginner ,
Oct 20, 2014 Oct 20, 2014

Copy link to clipboard

Copied

not bad, I'll definitely take a look!

thanks guys!!!

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
LEGEND ,
Oct 20, 2014 Oct 20, 2014

Copy link to clipboard

Copied

Thanks for the "plug" for PW.

Besides applying GREP-like styles, the GREP Processors in Power Headers enables things like automatically abbreviating headers and the like. There's two types of GREP Processors. One is limited to a single variable, while the other works in the whole header frame so it's possible to have some really interesting interactions between different variables.

Two features I've wanted to add to Power Headers for quite a long time is:

1) "script processors" which would allow saving some script snippets in a variable and have that script run on each header as it's produced. This would go along with some standardized variable names which would reference things like the text and the header frame.

2) Backwards headers to enable things like "next instance".

Of course life has been very busy and I've never gotten around to adding these features... Do they sound interesting?

Harbs

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
LEGEND ,
Oct 20, 2014 Oct 20, 2014

Copy link to clipboard

Copied

Hi Harbs,

Cool to read you!

I use a script that create headers, e.g., on left page inserting the 3 last words on the previous page (previous right page) and on right page inserting the 3 first words of the following page (following left page).

Not sure that Power Headers can actually do it?

Another point: Power Headers doesn't actually work with ID CC 2014? I've tried and apparently can't make it work! Can you confirm me this point?

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
LEGEND ,
Oct 20, 2014 Oct 20, 2014

Copy link to clipboard

Copied

I use a script that create headers, e.g., on left page inserting the 3 last words on the previous page (previous right page) and on right page inserting the 3 first words of the following page (following left page).

Not sure that Power Headers can actually do it?

I don't think so (although that might be a use for "script processors"). What's the application for that kind of header?

Another point: Power Headers doesn't actually work with ID CC 2014? I've tried and apparently can't make it work! Can you confirm me this point?

Correct. We're working on getting out CC 2014 support, but it's taken longer than I would have liked...

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 Beginner ,
Oct 20, 2014 Oct 20, 2014

Copy link to clipboard

Copied

Thanks for the suggestion!

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 Beginner ,
Oct 20, 2014 Oct 20, 2014

Copy link to clipboard

Copied

any advice on the GREP formula that I need?

GREP formula to automatically apply the character style sheet to apostrophes and double quotes

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
LEGEND ,
Oct 20, 2014 Oct 20, 2014

Copy link to clipboard

Copied

Hi,

As I said, using Power Headers is the best way to do it.

As Power Headers treats the header as "live text", you can use a simple grep style inserted in the header para style:

Capture d’écran 2014-10-20 à 11.10.35.png

… to obtain:

Capture d’écran 2014-10-20 à 11.10.50.png

For the sample, I use a char style named "-2pts" with Shift -5 pts and Green color to show you the place of ' and ".

Don't forget that, even Power Headers treats the header as "live text", you only have to update Power Headers to make an update of the headers! 

Even I use in another cases Tomaxxi's [JS] and it's a good way to treat the question, Jean-Claude Tremblay's solution is less interesting because the variable used is converted in text. If the variable text content changes, it's more complicated to manage the update!

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 Beginner ,
Oct 20, 2014 Oct 20, 2014

Copy link to clipboard

Copied

Yes, I saw Tomaxxi's script and I'm aware of the problem of the text update...

Power Headers is surely more "powerful"...

Many thanks for your 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
Community Beginner ,
Oct 21, 2014 Oct 21, 2014

Copy link to clipboard

Copied

Extra help:

with this GREP formula ['"] I select apostrophes, quotation marks “” and Guillemets «». Instead I want Guillemets not to be selected...

Only apostrophes and quotation marks “” need to be lowered -2pt on the baseline, not Guillemets of course!

Thanks for your 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
LEGEND ,
Oct 21, 2014 Oct 21, 2014

Copy link to clipboard

Copied

Hi,

Even I've no problem with this, you can use the unicode values (see glyphs), as (for me):  [\x{2019}\x{02DD}]

« = \x{00AB}

» = \x{00BB}

Capture d’écran 2014-10-21 à 12.20.04.png

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 Beginner ,
Oct 21, 2014 Oct 21, 2014

Copy link to clipboard

Copied

LATEST

It works perfectly, thanks Obi-wan

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