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

Help with syntax in FindChangeByList script

Community Beginner ,
Feb 21, 2024 Feb 21, 2024

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
502
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

Community Expert , Feb 23, 2024 Feb 23, 2024

It's pointSize, not fontSize

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

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

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

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.

 

 

 

 

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

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

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

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}

 

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

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.

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

It's pointSize, not fontSize

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

Thanks, pointSize is right.

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