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

script to pathitem convert to rectangle and expand appearance

Participant ,
May 10, 2024 May 10, 2024

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.pngexpand image

step2

ruihuang_1-1715328624241.pngexpand image

step3

ruihuang_2-1715328645969.pngexpand image

 

 

 

TOPICS
Scripting
373
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

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?

 

Translate
Adobe
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?

 

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

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

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

You're welcome.

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