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

Help with syntax in FindChangeByList script

Community Beginner ,
Feb 21, 2024 Feb 21, 2024

Copy link to clipboard

Copied

Hello everyone

 

I encountered a problem like this. When I write the two conditions of font + font size in FindChangeByList, only the font attribute works, but not the font size. I don’t know why? code show as below: 

grep	{findWhat:"勻",appliedFont:"方正书宋_GBK",fontSize:"10.5"}	{changeTo:"匀"}	{includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}

 

Not fontSize: "10.5" will also be replaced here.

TOPICS
Scripting

Views

305

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

Community Expert , Feb 23, 2024 Feb 23, 2024

It's pointSize, not fontSize

Votes

Translate

Translate
Community Expert ,
Feb 21, 2024 Feb 21, 2024

Copy link to clipboard

Copied

I am not sure if I understood this right. So you mean that it is not finding the correct result? What do you mean by fontSize: "10.5" will also be replaced here?

-Manan

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 ,
Feb 21, 2024 Feb 21, 2024

Copy link to clipboard

Copied

Hello, I mean, the characters that satisfy both (appliedFont:"方正书宋_GBK",fontSize:"10.5") are replaced.

 

When I write code, characters that are not (fontSize:"10.5") will also be replaced.

 

 

 

 

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 ,
Feb 21, 2024 Feb 21, 2024

Copy link to clipboard

Copied

Regardless of whether it is a size of 10.5 or not, it will be replaced.

 

But according to the code I wrote, it should only be replaced if it meets the font and size requirements. I don't know why fontSize doesn't work here

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 ,
Feb 21, 2024 Feb 21, 2024

Copy link to clipboard

Copied

Does it work with whole numbers?
Are there any character or paragraph styles applied (even nested styles) overriding the size?

Is the font name absolutely correct?


I've never done this before but could you apply a character style with the font size to the text?

grep {findWhat:"勻", appliedFont:"方正书宋_GBK"} {changeTo:"匀", appliedCharacterStyle:"YourCharacterStyleName"} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}

 

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 ,
Feb 22, 2024 Feb 22, 2024

Copy link to clipboard

Copied

I can replace the font name alone without any problem.
I added (fontSize="10.5") font size. Non 10.5 font size may also be replaced.
I don't have any style files, I just did a test. Add a name symbol (font+size)

 

I recorded the operation and see the attachment.

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 ,
Feb 23, 2024 Feb 23, 2024

Copy link to clipboard

Copied

It's pointSize, not fontSize

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 ,
Feb 25, 2024 Feb 25, 2024

Copy link to clipboard

Copied

LATEST

Thanks, pointSize is right.

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