Skip to main content
Participating Frequently
May 19, 2010
Question

Missing parameter in JS textframe duplicate (CS3)

  • May 19, 2010
  • 1 reply
  • 884 views

I have brought a text frame from the library onto my document and I wish to duplicate it. When I use the code

     var bFrame = aFrame.duplicate([100, 100]);

I get an error: "Missing required parameter 'to' for event 'duplicate'."

What am I doing wrong?

This topic has been closed for replies.

1 reply

tomaxxi
Inspiring
May 19, 2010

Hey!

Try this:

var  aFrame.selection[0];
var bFrame =  aFrame.duplicate([100, 100]);

This will duplicate selection, and put it on coordinates (x:100,y:100).

If you want to nudge duplicate from original position of selected object do following:

var  aFrame.selection[0];
var bFrame =  aFrame.duplicate(undefined,[100, 100]);

tomaxxi

crimsoAuthor
Participating Frequently
May 19, 2010

Many thanks. But that throws another error: "Expected: ;". I think aFrame.selection[0] addresses the text contained by the frame, not the frame itself.

tomaxxi
Inspiring
May 19, 2010

Hey!

It's my mistake!!! SORRY!

var  aFrame = app.selection[0];

tomaxxi