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

Creating a Rectangle and applying a gradient feather with a script

Explorer ,
Apr 16, 2024 Apr 16, 2024

Copy link to clipboard

Copied

Hi,

 

On InDesign, I create two documents, A and B.

On document A, I’m using the “app.activeDocument.pages[0].rectangles.add()” to create a new rectangle on the first page.

In document B, I create the same rectangle using the tool (manually).

I export both documents as an IDML and extract the XML files for the same spread, comparing their contents. In the IDML of document A ItemTransform of the rectangle is “1 0 0 1 5 -391” while in document B ItemTransform is “1 0 0 1 0 0”. Also in document A most of the properties like GradientFillStart, GradientStrokeStart, PathPointType, etc values for X and Y are sifted by 5 and -391.

The problem is that when I’m trying to create a GradientFeather using a script providing the proper values for gradientStart, angle, length, etc the result is never correct on Document A but always ok on document B.

I search by printing out all the properties for the two documents, spreads, pages, and rectangles and everything returns the same values for all the properties…

I saw in the IDML’s specs that those two numbers in the ItemTranform are “the horizontal and vertical distances to move the object, relative to the center of the pasteboard”. How can I change that with script thought…

If I change those two values and build back the IDML gradient feather is the same in documents A and B.

 

I’m sending you here the files to reproduce the issue. I have instructions are into the ScriptA.jsx

 

Regards,

 

Jim

TOPICS
Scripting

Views

153

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

Explorer ,
Apr 19, 2024 Apr 19, 2024

Copy link to clipboard

Copied

LATEST

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