I'm trying to add new artboard with the help of java script. I wasn't able to find solution nowhere. The scripting guidelines from adobe are just poor (to not use more strong words).
What ever I'm trying it returns the error
Error 1242: Illegal argument - argument 1 - Rectangle value expected
when I use value of `artboard.artboardRect` from other artboard then it creates artboard in the same place but I can't modify it (resize) which makes this option useless.
artboards.add(artboards[0].artboardRect);//works
artboards.add([0,0,200,50]);//Error 1200: an Illustrator error coccurred: 1346458189('PARAM')
var rect = artboards[0].artboardRect;
rect[0] = 0;
rect[1] = 0;
rect[2] = 200;
rect[3] = 50;
artboards.add(rect);//Error 1242: Illegal argument - argument 1 - Rectangle value expected
new Rectangle yields to "Rectangle doesnt have constructor"