Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


FindChangeBy.txt Help – Superscripting

Explorer ,
May 25, 2021 May 25, 2021

Copy link to clipboard

Copied

Hi There, 

 

I'm creating a FindChangeBy list of GREPs to run, and I'm trying to Superscript ordinals as one of my items. But I dont' know how to write the code to say position = Superscript. I have my Find what, I just don't know what my second item needs to be. Please help

TOPICS
How to, Scripting

Views

274

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
community guidelines

correct answers 1 Correct answer

Adobe Community Professional , May 25, 2021 May 25, 2021
It seems you are missing the escaping of the special characters. Change \ with \\ so the first grep string should be like following grep {findWhat:"\\d\\K(th|st|nd|rd)\\>|[\\w\\s]\\K(~r)"} {position:Position.SUPERSCRIPT} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} -Manan

Likes

Translate

Translate
Adobe Community Professional ,
May 25, 2021 May 25, 2021

Copy link to clipboard

Copied

Try

position = Position.SUPERSCRIPT

-Manan

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
community guidelines
Explorer ,
May 25, 2021 May 25, 2021

Copy link to clipboard

Copied

I may need more explanation than that. Is this correct?

 

grep {findWhat:"\d\K(th|st|nd|rd)\>|[\w ]\K(~r)"} {position = Position.SUPERSCRIPT} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}

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
community guidelines
Adobe Community Professional ,
May 25, 2021 May 25, 2021

Copy link to clipboard

Copied

Replace = with :

So it becomes

{position:Position.SUPERSCRIPT}

-Manan

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
community guidelines
Explorer ,
May 25, 2021 May 25, 2021

Copy link to clipboard

Copied

It still isn't working. Do I need to add something like changeTo: to it? Here is my full FindChangeBy list:

 

grep {findWhat:"\d\K(th|st|nd|rd)\>|[\w\s]\K(~r)"} {position:Position.SUPERSCRIPT} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}
grep {findWhat:" ([\u]{2}) +(\d{5})"} {changeTo:" $1~>$2"} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}
grep {findWhat:" (([\u\l]) (Jr|Jr.|Sr|Sr.|Esq|Esq.)( |\n|\r|\t|~y)"} {changeTo:"$1, $2$3"} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}

 

What would be the reason that this isn't working? My GREP works fine for the layout, but it seems I don't know enough about code yet to troubleshoot

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
community guidelines
Adobe Community Professional ,
May 25, 2021 May 25, 2021

Copy link to clipboard

Copied

It seems you are missing the escaping of the special characters. Change \ with \\ so the first grep string should be like following

grep {findWhat:"\\d\\K(th|st|nd|rd)\\>|[\\w\\s]\\K(~r)"} {position:Position.SUPERSCRIPT} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}

-Manan

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
community guidelines
Explorer ,
May 25, 2021 May 25, 2021

Copy link to clipboard

Copied

LATEST

That was it. Thank you. Didn't realize I needed to escape them even when its within quotes. 

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
community guidelines