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

How to Delete Specific Polygons Based on Width and Height Excluding Master/Parent Pages

Enthusiast ,
Mar 13, 2022 Mar 13, 2022

Copy link to clipboard

Copied

Hi Experts,

please can you help me to update this code :

//Delete All Polygons form Current Document
var myPolygonFrames = app.activeDocument.polygons;

for (i=myPolygonFrames.length-1; i>=0; i--) {
        myPolygonFrames[i].remove();
}

the above code is working to delete all the polygons in the current document, but i want to update it to exclude master/parent pages and also i searched the dom to try to make it target specific polygons with width and height values but i didnt find  anything about that,, please help!,  and many thanks in advance.

Best
M.Hasanain
TOPICS
Scripting

Views

90

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 , Mar 13, 2022 Mar 13, 2022

How would you think to? 

 

polygon.parentPage.parent instance of MasterSpread will tell you if the polygon is on a parent spread. 

 

polygon.geometricBounds can get you height and width. 

Likes

Translate

Translate
Community Expert ,
Mar 13, 2022 Mar 13, 2022

Copy link to clipboard

Copied

How would you think to? 

 

polygon.parentPage.parent instance of MasterSpread will tell you if the polygon is on a parent spread. 

 

polygon.geometricBounds can get you height and width. 

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
Enthusiast ,
Mar 13, 2022 Mar 13, 2022

Copy link to clipboard

Copied

LATEST

Thanks a lot @brianp311 

Best
M.Hasanain

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