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

InDesign scripting question re page numbers

Participant ,
Dec 05, 2022 Dec 05, 2022

Copy link to clipboard

Copied

Hi everyone,

Please can someone helpo me...

I have a grep find set up in a script and all works fine.

Just wondered if it's possible to get the page number of each instance returned by the grep find?

Thanks in advance.

TOPICS
How to , Scripting

Views

348

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

Community Expert , Dec 05, 2022 Dec 05, 2022

Grep find typically returns a Text object. From there, you can get myFind.parentTextFrames[0].parentPage. Note that if the item is on the pasteboard, parentPage is null. Or if it extends across multiple text frames those frames might be on different pages. 

Likes

Translate

Translate
Community Expert ,
Dec 05, 2022 Dec 05, 2022

Copy link to clipboard

Copied

Grep find typically returns a Text object. From there, you can get myFind.parentTextFrames[0].parentPage. Note that if the item is on the pasteboard, parentPage is null. Or if it extends across multiple text frames those frames might be on different pages. 

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
Participant ,
Dec 05, 2022 Dec 05, 2022

Copy link to clipboard

Copied

Hi Brian,

Thanks for the help, I'll give that a go 👍

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
Community Expert ,
Dec 05, 2022 Dec 05, 2022

Copy link to clipboard

Copied

For an example implementation of what @brianp311 described, see this post (search for "function textPage").

- Mark

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
Participant ,
Dec 05, 2022 Dec 05, 2022

Copy link to clipboard

Copied

LATEST

Hi Mark,

Thanks for the help, the linked discussion looks good 👍

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