Apparently, it is not possible to set an artobard's artboardRect property individually, for example artboardRect for the left position of the artboard. The artboardRect property must be set all at once to take effect, in other words, an array with four values corresponding to [left, top, right, bottom] must be passed to it. Assuming this is true, how am I supposed to gather this requirement when reading the Scripting Reference manual? The manual just reads:
artboardRect rect Size and position of the arboard.
In fact, how am I supposed to gather from the Scripting Reference manual that rect for rectangle is defined by the following parameters [left, top, right, botom]?
Obviously, I feel a lot of other items in the document lack the necessary information for correct usage so I thought perhaps I am not using that document properly.
This is for CS4.
Hello hello, if you want change one border only for example left border, you can write it :
var myArtboard = app.activeDocument.artboards;
myArtboard.artboardRect = [
Hi Steven. You are assigning all four values. Try myArtboard.artboardRect = 100 and see if it takes the value!
Maybe, I misunderstood your question ^^. I think you can't assign one value for one item only, when property accept one Point value or Rect value, you reassign others value in same instruction.
Unfortunately, that's the way it is with the scripting references. To make matters worse, there are things left out of the references completely, even though they have been an open secret for years. I suspect that this is apathy rather than cynicism. On a positive note, this forum will more often than not give you the answer you're looking for.
Edit: Similarly, I seem to remember that the x and y elements of the "position" property cannot be assigned individually, i.e. "position" must be assigned an array [x, y].
You must be right. I struggle to get my head around this reference document sometimes (most of the time, I should say). Some of the entries have examples but many don't. It's unfortunate because the presumably missing information really reduces the value of an otherwise well-intended document. As usual with such things, I uncover the issue through an error and waste time trying to figure out whether I am doing something wrong or if it's a bug! Well here, it seems I was doing something wrong thanks to a lack of explanation, at least it's not a bug. 😉
The documentation is terrible, and in some ways getting worse as I don't think there's even been an official update for AI since 2017 - I guess all their efforts are being directed towards UXP.
So it's pretty much been left to the community!
The best resources I've found are the open-source community-contributed docs here: https://docsforadobe.dev/
Then @CarlosCanto updates these forums with everything new he is able to reverse engineer from each release: