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

How to define a pageItems and a masterPageItems?

Contributor ,
Oct 28, 2015 Oct 28, 2015

Copy link to clipboard

Copied

Hi experts

I got this script.

//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

var myDoc = app.activeDocument;

    var myMasters = myDoc.masterItems.everyItem();

    var myObjects = myDoc.pageItems.everyItem().getElements();

          myDoc.pageItems.everyItem().locked = false;

            var myLayers = myDoc.layers.everyItem();

                   myLayers.locked = false;

                    app.findObjectPreferences = app.changeObjectPreferences = null;

                    app.findObjectPreferences.fillColor = "Registration"; 

                    app.changeObjectPreferences.fillColor = "Black"; 

                    app.changeObject();

                   

                    app.findObjectPreferences = app.changeObjectPreferences = null;

                    app.findObjectPreferences = NothingEnum.nothing;

                    app.changeObjectPreferences = NothingEnum.nothing; 

                    app.findObjectPreferences = app.changeObjectPreferences = null;

                    app.findObjectPreferences.strokeColor = "Registration"; 

                    app.changeObjectPreferences.strokeColor = "Black"; 

                    app.changeObject();

                   

                    app.findObjectPreferences = app.changeObjectPreferences = null;

                    app.findObjectPreferences = NothingEnum.nothing;

                    app.changeObjectPreferences = NothingEnum.nothing; 

                    app.findTextPreferences = app.changeTextPreferences = null;

                    app.findTextPreferences.fillColor = "Registration"; 

                    app.changeTextPreferences.fillColor = "Black"; 

                    app.changeText();

                   

                    app.findTextPreferences = app.changeTextPreferences = null;

                    app.findTextPreferences = NothingEnum.nothing;

                    app.changeTextPreferences = NothingEnum.nothing; 

                    app.findTextPreferences = app.changeTextPreferences = null;

                    app.findTextPreferences.strokeColor = "Registration"; 

                    app.changeTextPreferences.strokeColor = "Black"; 

                    app.changeText();

                   

                    app.findTextPreferences = app.changeTextPreferences = null;

//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

but want it either work on every page and every master page.

How can define it?

thanks

Regard

John

TOPICS
Scripting

Views

422

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

LEGEND , Oct 30, 2015 Oct 30, 2015

Set app.findChangeObjectOptions.includeMasterPages = true and app.findChangeTextOptions.includeMasterPages = true

Votes

Translate

Translate
LEGEND ,
Oct 29, 2015 Oct 29, 2015

Copy link to clipboard

Copied

I'm not sure what you mean. This script should work on the entire document. What are you trying to do differently?

BTW, the script has a bug. It should be myDoc.changeObject() and myDoc.changeText() instead of working on the app level.

Harbs

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
Contributor ,
Oct 29, 2015 Oct 29, 2015

Copy link to clipboard

Copied

Hi Harbs

It work on pages but Master page.

Regard

John

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
LEGEND ,
Oct 30, 2015 Oct 30, 2015

Copy link to clipboard

Copied

Set app.findChangeObjectOptions.includeMasterPages = true and app.findChangeTextOptions.includeMasterPages = true

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
Contributor ,
Oct 30, 2015 Oct 30, 2015

Copy link to clipboard

Copied

LATEST

Thank you Harbs

Thank you so much.

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