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

Duplicate Part of a Compound Path Question

Engaged ,
Apr 14, 2023 Apr 14, 2023

Hello All,

Is there a way Script wise that I can only duplicate the outermost path of a Compound Path?

My first attempt was to duplicate the whole compound path which worked... if I selected the Script manually... and did not work when I used the Action Panel to call the Script.


    var objectHeight = selectedObject.height;
    var objectWidth = selectedObject.width;
    var duplicatedObject = selectedObject.duplicate();
        duplicatedObject.left = selectedObject.left - (objectWidth * 2);
   app.activeDocument.selection = null;
    duplicatedObject.selected = true;
    app.executeMenuCommand("noCompoundPath");
    app.executeMenuCommand("ungroup");

 

TOPICS
Scripting
281
Translate
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
Adobe
Guide ,
Apr 15, 2023 Apr 15, 2023
LATEST

This duplicates the topmost path in a selected compound path.  (The duplicate will still be within the compound path; if it should be out, it will have to be moved out.)

var dup = app.selection[0].pathItems[0].duplicate();
dup.position = [0, 0];

If you want to duplicate the bottommost path, change the path's index to app.selection[0].pathItems.length - 1.

 

 

Translate
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