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

Convert page numbers to text

Explorer ,
Oct 16, 2020 Oct 16, 2020

Copy link to clipboard

Copied

Hi, does exist any script to convert page number (~N) inserted to text to simply text? I mean remove it and paste the number to this place.
Thank you... Ilja

TOPICS
How to , Scripting

Views

757

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

Advocate , Oct 17, 2020 Oct 17, 2020

Try this code snippet:

main();
function main(){
    app.findGrepPreferences = null;
    app.changeGrepPreferences = null;
    app.findChangeGrepOptions.includeMasterPages = true;
    app.findGrepPreferences.findWhat="~N";
    var FindGrep=app.activeDocument.findGrep();
    for(i=0; i<FindGrep.length; i++){
        var item = FindGrep;
        var page = item.parentTextFrames[0].parentPage;
        if(page != null){
            item.contents = page.name;
            }
        }
    app.findGrepPr
...

Votes

Translate

Translate
Community Expert ,
Oct 17, 2020 Oct 17, 2020

Copy link to clipboard

Copied

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
Advocate ,
Oct 17, 2020 Oct 17, 2020

Copy link to clipboard

Copied

LATEST

Try this code snippet:

main();
function main(){
    app.findGrepPreferences = null;
    app.changeGrepPreferences = null;
    app.findChangeGrepOptions.includeMasterPages = true;
    app.findGrepPreferences.findWhat="~N";
    var FindGrep=app.activeDocument.findGrep();
    for(i=0; i<FindGrep.length; i++){
        var item = FindGrep;
        var page = item.parentTextFrames[0].parentPage;
        if(page != null){
            item.contents = page.name;
            }
        }
    app.findGrepPreferences = null;
    app.changeGrepPreferences = null;
    }  

Best

Sunil

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