[JS] [CS5] Copy and paste into existing array


hi guys,

 

 

right i'm trying improve performance of script wrote copying , pasting pdf instead of loading 10 times.

 

and here's problem:

when pasting copied pdf doesn't paste array original pdf in need further script.

can somehow paste pdf array , specific position [i]?

 

i'm adding important parts of script.

 

greetings michael

 

var mydocument = app.activedocument;

var mypage = mydocument.pages.item(0);

 

var mypageheight = mydocument.documentpreferences.pageheight;

var mypagewidth = mydocument.documentpreferences.pagewidth;

 

myvertical=new array();

 

var myverticalcount=0;

 

var mystrokeheight = myvertical[0].geometricbounds[2]-myvertical[0].geometricbounds[0];

var mystrokewidth = myvertical[0].geometricbounds[3]-myvertical[0].geometricbounds[1];

 

for(i = 0; (mypagewidth-(i*mystrokewidth))/(i+1) > (mystrokewidth/3);i++){

                        myhorizontalcount++;

                    }

               

myvertical[0] = mypage.rectangles.add({geometricbounds:[mypageheight/2,0,mypageheight +3,3]});

myvertical[0].place (file(myfile_vert));

myvertical[0].strokeweight = 0;

myvertical[0].fit (fitoptions.frame_to_content);

 

 

app.select (null);

                  

                    //it should pasted array myvertical[i]

 

                    app.select (myvertical[0]);

                    app.copy ();

                   

                    for(i=1;i<myverticalcount;i++)

                        {

                            app.paste();               //into myvertical[i] somehow

                        }

doesn't know how this?

 

if not, possible to:

 

 

               1. select multiple grapics in defined area @ once?

 

               or

 

               2. paste graphic , add graphic selection without deselecting items i've selected before?

 

thanks in advance

michael



More discussions in InDesign Scripting


adobe

Comments

Popular posts from this blog

Joomla 3.3 Installation Error message - Joomla! Forum - community, help and support

Multilanguage infinite redirect loop error. - Joomla! Forum - community, help and support

trim media limit reached