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

Need help for a Script Fix

Contributor ,
Nov 12, 2017 Nov 12, 2017

I have a paragraph style with a first line indent of 0.25 inches. My imported text has much wider indent and so I've run the script below in Find and Replace to remove the space before indent. Unfortunately it only removes some of the space but not all and I have to manually fix the indents. Does anyone know how to tweak this code or is there an alternate script?  Thank you!

^ +?(.)

TOPICS
Scripting
1.7K
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

Enthusiast , Nov 12, 2017 Nov 12, 2017

Find ^(\s+)?(.)

Replace $2

Translate
Community Expert ,
Nov 12, 2017 Nov 12, 2017

Moving to InDesign Scripting forum

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 12, 2017 Nov 12, 2017

Surely not! … a simple Grep problem to be fixed!

"Script" doesn't systematically mean "Scripting"! Just need to read the question!

(^/)

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 ,
Nov 12, 2017 Nov 12, 2017

So how do I fix this?

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 ,
Nov 12, 2017 Nov 12, 2017

Find ^(\s+)?(.)

Replace $2

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 ,
Nov 12, 2017 Nov 12, 2017

That worked!! 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
Contributor ,
Nov 12, 2017 Nov 12, 2017

Thanks again!

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 12, 2017 Nov 12, 2017

Humm! Once again!

Of course, it will work but I'm absolutely and definitively not interested by this kind of Grep writing!

Find:  ^\h+

Replace by:  nothing

(^/)

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 ,
Nov 12, 2017 Nov 12, 2017

Or just ^\s+ replacing for nothing.

Oh, my God, Obi. You're a genius.

Oh, my God. I never seen anyone like you.

Never.

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 12, 2017 Nov 12, 2017

I'm glad you learned something today! 

… But anyone who knows a little Grep would have made the same comment! So, useless to be ironic!

(^/)

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 12, 2017 Nov 12, 2017

… And  ^\s+  is not equal to  ^\h+  really less greedy, especially useful if you take a look to the screenshot posted by Norman!

(^/) 

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 ,
Nov 12, 2017 Nov 12, 2017

Yes. Of course. Because of that you're a genius. You're the best of the

bests in grep and scripting.

But... Wow... Both works the same way.

But, look... I'm your fan. You're the best!!!

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 12, 2017 Nov 12, 2017
… Both works the same way.

Absolutely not!

(^/) [End of this thread for me!]

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 ,
Nov 12, 2017 Nov 12, 2017

Absolutely yes. Both deals with the extra spaces the post owner asked 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 12, 2017 Nov 12, 2017

Test your 2 codes on Norman's screenshot text! …

[OFF!]

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 ,
Nov 12, 2017 Nov 12, 2017

The first one worked for him.

Finish. Off.

Not always the things needs to be complicated. In most cases, the simplest

ways works fine.

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 12, 2017 Nov 12, 2017

Aha! Not sure it works correctly! …

As I already said: test!

I forgot! … You're wrong here too:

Re: Time formatting in indesign

(^/) [over!]

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 ,
Nov 12, 2017 Nov 12, 2017

I'm not wrong. I just didn't used the same format than you. If it works; it

works.

You're the most clever man in this entire universe. I forgot to say.

Thanks for "share" your knowledge with us in this forum without charging

for it (ops!).

There is any other place where you share your adorable way to solve grep

and scripting stuff?

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 ,
Nov 12, 2017 Nov 12, 2017
LATEST

Did 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
Contributor ,
Nov 12, 2017 Nov 12, 2017

You are both genius in my book!

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 12, 2017 Nov 12, 2017

Norman,

Could you post screenshots with the invisible chars?

(^/)

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 ,
Nov 12, 2017 Nov 12, 2017

Here's a screenshot

Thanks for your help with this.

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 ,
Nov 12, 2017 Nov 12, 2017

Screen Shot 2017-11-12 at 10.11.29 AM.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
LEGEND ,
Nov 12, 2017 Nov 12, 2017

Do you just wanna remove the spaces at the beginning of para?

(^/)

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 ,
Nov 12, 2017 Nov 12, 2017

I want it to have the 0.25 in. indent that's in my style. No extra spacing.

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