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

script to pathitem convert to rectangle and expand appearance

Participant ,
May 10, 2024 May 10, 2024

Copy link to clipboard

Copied

Hi there,

 

how to write script to below three steps for pathitem ,  thanks

 

pathitem .CONVERT_TO_RECTANGLE;

script to step2 and step3

artb.add(pathitem.geometricBounds);

 

step1,

ruihuang_0-1715328592676.png

step2

ruihuang_1-1715328624241.png

step3

ruihuang_2-1715328645969.png

 

 

 

TOPICS
Scripting

Views

188

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 , May 10, 2024 May 10, 2024
  1. What ist your Illustrator version?
  2.  Why so complicated?

 

Please try it with a newer version (open document and one pathItem required)

var aDoc = app.activeDocument;
var pItBds = aDoc.pathItems[0].geometricBounds;

aDoc.artboards.add ([ pItBds[0], pItBds[1], pItBds[0]+(pItBds[2]-pItBds[0]), pItBds[1]+(pItBds[3]-pItBds[1]) ])

 

Does that makes sense for you?

 

Votes

Translate

Translate
Adobe
Community Expert ,
May 10, 2024 May 10, 2024

Copy link to clipboard

Copied

  1. What ist your Illustrator version?
  2.  Why so complicated?

 

Please try it with a newer version (open document and one pathItem required)

var aDoc = app.activeDocument;
var pItBds = aDoc.pathItems[0].geometricBounds;

aDoc.artboards.add ([ pItBds[0], pItBds[1], pItBds[0]+(pItBds[2]-pItBds[0]), pItBds[1]+(pItBds[3]-pItBds[1]) ])

 

Does that makes sense for you?

 

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
Participant ,
May 12, 2024 May 12, 2024

Copy link to clipboard

Copied

You've been a great help. Thank you for sharing your knowledge and solving my problem.

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
Community Expert ,
May 13, 2024 May 13, 2024

Copy link to clipboard

Copied

LATEST

You're welcome.

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