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

Find and replace object and font

New Here ,
Apr 11, 2017 Apr 11, 2017

Copy link to clipboard

Copied

i was trying to flip objects with stroke value other than zero, so i tried the below code after selecting the object

app.selection[0].absoluteFlip = Flip.HORIZONTAL;

and it worked but i want to automate this process so i tried the below code

app.findObjectPreferences = NothingEnum.nothing;

app.changeObjectPreferences = NothingEnum.nothing;

app.findObjectPreferences.strokeWeight != "0";

app.changeObjectPreferences.absoluteFlip = Flip.HORIZONTAL;

app.changeObjectPreferences.flip;

myDocument.changeObject();

but it gives error because "absoluteFlip" cant be used with "changeObjectPreferences " so what should i do

and also i dont know how to adjust settings for find object like "includeFootnotes" and "includeHiddenLayers"

the same way i do with find/replace text and grep

also i was trying to automate find and replace fonts using grep but i faced a problem with empty text frames and empty tables

i solved the text frames problem but i dont know how to do it in tables can any body help me in these two problems

TOPICS
Scripting

Views

1.3K

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

Guide , Apr 11, 2017 Apr 11, 2017

Hi..

You cant use != condition directly in find preference..

use this code..

app.findObjectPreferences=app.changeObjectPreferences=null;

app.findObjectPreferences.strokeWeight=1;

myFindObj=app.findObject(true);

for(i=0;i<myFindObj.length;i++){

    if(myFindObj.strokeWeight!=0){

        myFindObj.flipItem(Flip.HORIZONTAL, AnchorPoint.CENTER_ANCHOR);

}

}

Votes

Translate

Translate
Guide ,
Apr 11, 2017 Apr 11, 2017

Copy link to clipboard

Copied

Hi..

You cant use != condition directly in find preference..

use this code..

app.findObjectPreferences=app.changeObjectPreferences=null;

app.findObjectPreferences.strokeWeight=1;

myFindObj=app.findObject(true);

for(i=0;i<myFindObj.length;i++){

    if(myFindObj.strokeWeight!=0){

        myFindObj.flipItem(Flip.HORIZONTAL, AnchorPoint.CENTER_ANCHOR);

}

}

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
Guide ,
Apr 12, 2017 Apr 12, 2017

Copy link to clipboard

Copied

LATEST

Please remove the line 2 in the above script (app.findObjectPreferences.strokeWeight=1).. I forget to remove that.. so it will work for all cases

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