Question
CS3 JS Add group into frame
Hi
In InDesign UI you can copy a group of frames and paste it into another frame.
I'm trying to replicate the results via JS
I tried this:
x = app.activeDocument.rectangles.add();
y = app.activeDocument.ovals.add();
z = app.activeDocument.ovals.add();
x.groups.add([y,z]);
then this:
x = app.activeDocument.rectangles.add();
x.groups.add([app.activeDocument.ovals.add(),app.activeDocument.ovals.add()]);
Both attempts ended up with "Invalid parameter" error message
Then I tried this:
x = app.activeDocument.rectangles.add();
y = app.activeDocument.ovals.add();
z = app.activeDocument.ovals.add();
g = app.activeDocument.groups.add([y,z]);
g.select();
app.cut();
x.select();
app.pasteInto();
It did the job without errors, but I'm affraid it will be unnecessary slow in real world deployment.
Please, can anyone explain what I did wrong with my first two attempts?
Thanks for help
Weller
In InDesign UI you can copy a group of frames and paste it into another frame.
I'm trying to replicate the results via JS
I tried this:
x = app.activeDocument.rectangles.add();
y = app.activeDocument.ovals.add();
z = app.activeDocument.ovals.add();
x.groups.add([y,z]);
then this:
x = app.activeDocument.rectangles.add();
x.groups.add([app.activeDocument.ovals.add(),app.activeDocument.ovals.add()]);
Both attempts ended up with "Invalid parameter" error message
Then I tried this:
x = app.activeDocument.rectangles.add();
y = app.activeDocument.ovals.add();
z = app.activeDocument.ovals.add();
g = app.activeDocument.groups.add([y,z]);
g.select();
app.cut();
x.select();
app.pasteInto();
It did the job without errors, but I'm affraid it will be unnecessary slow in real world deployment.
Please, can anyone explain what I did wrong with my first two attempts?
Thanks for help
Weller