Copy link to clipboard
Copied
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!
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more