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

create a rectangle with a image inside

New Here ,
Mar 23, 2016 Mar 23, 2016

Copy link to clipboard

Copied

Hi all

Question of great starter... how create a rectangle with a image inside.

My project :

- Create a dialogue box where put the name of the picture.

- create the link between the picture to the active document (picture is in "Links" folder)

- do a rectangle in my document with a picture inside.

All the think is ok except the last stage (on a start, i was mind "that is the most easier"... but no).

Thank a lot, and sorry for my english.

TOPICS
Scripting

Views

424

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

Advisor , Mar 24, 2016 Mar 24, 2016

to add a rectangle:

var rect=doc.rectangles.add();

to place a picture inside it:

rect.place(FIle(image.path));

Likes

Translate

Translate
Guide ,
Mar 23, 2016 Mar 23, 2016

Copy link to clipboard

Copied

Hi,

Adobe giving some free scripts you can use that. Name of script is ImageCatalog.jsx.

Thanks,

Karthi

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
Advisor ,
Mar 24, 2016 Mar 24, 2016

Copy link to clipboard

Copied

to add a rectangle:

var rect=doc.rectangles.add();

to place a picture inside it:

rect.place(FIle(image.path));

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
New Here ,
Mar 24, 2016 Mar 24, 2016

Copy link to clipboard

Copied

Simple and powerful, thank a lot.

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
New Here ,
Nov 07, 2022 Nov 07, 2022

Copy link to clipboard

Copied

Hi @Vamitul  

adding to same issue i have if we want to changes the bounds of the rectangle after place image

1-add a rectangle

2-place image

3-change the rectangle bounds (which result in cropping of image)

can we do this with script ?

Thanks in Advance!!

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
Community Expert ,
Nov 07, 2022 Nov 07, 2022

Copy link to clipboard

Copied

LATEST

You can set the geometricBounds of the rectangle. It is an array of numbers in the format [y1, x1, y2, x2]. You might want to also look at setting the measurement units before making the change, if you want to set the values in a unit other than points

https://www.indesignjs.de/extendscriptAPI/indesign-latest/#MeasurementUnits.html#d1e78257

-Manan

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