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

app.activeDocument.distribute is not a function

Explorer ,
Aug 01, 2019 Aug 01, 2019

Every align/distribute script seems to use this function, but if I run it, I just get "app.activeDocument.distribute is not a function"

the script has already selected the items and then it fails on this distribute line. 

What am I doing wrong?

the offending line (though I've tried variations from other scripts)

app.activeDocument.distribute(app.activeDocument.selection, DistributeOptions.HORIZONTAL_SPACE, AlignDistributeBounds.ITEM_BOUNDS, false);

Thanks in advance!

TOPICS
Scripting
876
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
Contributor ,
Aug 01, 2019 Aug 01, 2019

I don't think, that there is distribute function in Illustrator, it looks like inDesign function.

You will have to write the code for distribiution, or use actions.

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
Valorous Hero ,
Aug 01, 2019 Aug 01, 2019
LATEST

Those are InDesign scripts, but in Illustrator for now we have to manually do any distribution by translating various art objects using functions like pageItem.translate(dX, dY), etc and using manual maths for those dX and dY values.

InDesign has much more scripting power than Illustrator, so it isn't uncommon for someone to mistake an InDesign script for an Illustrator script, or to assume that the scripting commands are going to be the same for both the programs.

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