Highlighted

InDesign Live Captions GREP styles (remove prefix & suffix from name)

New Here ,
Apr 11, 2020

Copy link to clipboard

Copied

Hello, I found the post about removing the file extension at the end of a live caption, but I am also trying to remove a number followed by a period at the beginning. My client shares photo files with this naming style: "1. Caption of image is written out here.jpg". The numbering goes from single to double digits, and is always followed by a period and a space. I am trying to automatically remove the number, period, and space at the beginning as well as the file extension at the end, while keeping the middle bit as my live caption. Any suggestions?

 

Thanks!

Topics

How to

Views

591

Likes

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

InDesign Live Captions GREP styles (remove prefix & suffix from name)

New Here ,
Apr 11, 2020

Copy link to clipboard

Copied

Hello, I found the post about removing the file extension at the end of a live caption, but I am also trying to remove a number followed by a period at the beginning. My client shares photo files with this naming style: "1. Caption of image is written out here.jpg". The numbering goes from single to double digits, and is always followed by a period and a space. I am trying to automatically remove the number, period, and space at the beginning as well as the file extension at the end, while keeping the middle bit as my live caption. Any suggestions?

 

Thanks!

Topics

How to

Views

592

Likes

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
Adobe Community Professional ,
Apr 26, 2020

Copy link to clipboard

Copied

I'm not a from-the-top-of-my-head GREP formulist, so you have to do some tinkering yourself.

Because I did find many articles discussing some GREP sequences in a comprehensible manner.

Simply Google "indesign grep delete characters" and they tumble over your screen, like this one:

https://indesignsecrets.com/indesign-grep-essentials-how-to-add-delete-and-re-arrange-text.php

Note: you can't assign a GREP Style to edit a text, but you can let GREP do it in Find/Change.

Likes

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
Reply
Loading...
Adobe Community Professional ,
Apr 26, 2020

Copy link to clipboard

Copied

As Peter indicated, you can't delete characters with a GREP style; however, you can hide them if that's a solution that works for your project.

 

1. Create a character style with a Size of 0.1 and the Character Color set to None.

Screenshot 2020-04-26 13.40.38.png

Screenshot 2020-04-26 13.40.46.png

 

2. In your caption paragraph style, in the GREP Style pane, create two GREP styles applying the character style using the following GREP patterns:

^\d{1,2}\.\s

\.jpg$

Screenshot 2020-04-26 13.42.32.png

Likes

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
Reply
Loading...
Adobe Community Professional ,
Apr 26, 2020

Copy link to clipboard

Copied

Guess I should test before posting, as the solution above will only work if the Live Caption is converted to a Static Caption. InDesign sees the text in Live Captions as a single entity, not as individual characters.

Likes

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
Reply
Loading...
Adobe Community Professional ,
Apr 26, 2020

Copy link to clipboard

Copied

I would add one more attribute: Horizontal scale 1%.

Likes

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
Reply
Loading...
Adobe Community Professional ,
Apr 26, 2020

Copy link to clipboard

Copied

Nice, all these tips ! That should get the ball rolling' 🙂

Likes

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
Reply
Loading...
Advocate ,
Apr 26, 2020

Copy link to clipboard

Copied

Hi!

 

Surely the kind of answer [David's one] I would have given years ago, but not now anymore! …

 

Go to Bridge, open the images folder and updating, e.g., the "Title" metadata with this kind of Grep treatment:

 

"Title" (metadata) = Filename.replace(/^\d+\.\s/, "").replace(/\.\w+$/, "") (metadata)

 

See the screenshot: filename = "2. Photo_ZZZ.JPG" ==> title = Photo_ZZZ

 

Capture d’écran 2020-04-27 à 00.27.13.png

 

[1 click!]


Come back to InDesign, select all the links in the Links panel and update them! [idem]

 

That's all: All the captions are still "live", no "static" at all!

 

(^/) The Jedi

Likes

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
Reply
Loading...
Adobe Community Professional ,
Apr 26, 2020

Copy link to clipboard

Copied

Hi Michel,

 

That's a cool trick. However, I could not get it to work. I'm getting the literal text from the Title field. I tried some variations of the code string in the event that I'm misinterpreting what should go in the field, but no luck.

Screenshot 2020-04-26 21.56.46.png

Screenshot 2020-04-26 22.01.02.png

Screenshot 2020-04-26 22.01.40.png

Likes

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
Reply
Loading...