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

JS how to split the object to two diffrent parts ,like this:

Participant ,
Jun 12, 2016 Jun 12, 2016

JS how to split the object to two diffrent parts ,like this:002.jpg

TOPICS
Scripting
897
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
Community Expert ,
Jun 13, 2016 Jun 13, 2016

we're going to need more info about exactly what you're trying to do and the structure of your file so we can help plan for problems..

in it's simplest form, the code would go like this:

function splitParts()

{

     var docRef = app.activeDocument;

     var item1 = docRef.pathItems[0];

     var item2 = docRef.pathItems[1];

     item1.top = item1.top + 50;

     item2.top = item2.top - 50;

}

splitParts();

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
Participant ,
Jun 13, 2016 Jun 13, 2016

003.jpgsorry ,

the object have only one pathItems ,have not two pathItems .

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
Participant ,
Jun 14, 2016 Jun 14, 2016

As an options:

var s = selection[0],

    i = s.pathItems.length,

    obj = s.parent;

while ( i-- ) s.pathItems.moveToBeginning( obj );

s.remove();

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
Community Expert ,
Jun 14, 2016 Jun 14, 2016

can you send a sample file so we can see exactly what needs to be done?

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
Participant ,
Jun 14, 2016 Jun 14, 2016
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
Participant ,
Jun 16, 2016 Jun 16, 2016

up

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
Participant ,
Jun 19, 2016 Jun 19, 2016

up

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
Community Expert ,
Jun 20, 2016 Jun 20, 2016
LATEST

please use google drive or dropbox or some other reputable file sharing service. no zip files

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