Script that adds objects every 2ft.


hi,

 

so need make script adds object every 2 feet around perimeter of page.

i have no idea how start. if point me in right direction, or show me example of similar being done, awesome!

this have far:

 

 

if (x2 >= 96 || y2 >= 96) { /* if x or y longer 8 feet (96 inches) */         var x = x2/24;     while (x > 36 && x < 24) { /* objects need added every 2 3 feet */         x /= 24;     }      var y = y2/24;     while (y > 36 && y < 24) { /* objects need added every 2 3 feet */         y /= 24;     } } 

 

what i've been thinking (and have) fixed amount between 2 3 feet. divide total x or total y fixed amount, , tells me how many objects i'll need add.

i feel i'm heading on right track, making elements seems challenging part. have function makes element need, , function formatted this: addcircle(page, top, left, bottom, right);

 

any appreciated! thanks.

 

edit:

 

i have come solution! (somewhat)

so far 1 side, works:

 

 

var x = x2/24; while (x > 36 && x < 24) {     x /= 24; } x = math.round(x); var stride = (x2/x);          (var = 0; <= x; i++) {     if (i == 0) {         addcircle (mypage, 0.25, stride*i + 0.25, 0.5, stride*i + 0.5);     } else if (i == x) {         addcircle (mypage, 0.25, stride*i - 0.25, 0.5, stride*i);     } else {         addcircle (mypage, 0.25, stride*i, 0.5, stride*i + 0.25);     } }  

it seems on right track, i'm curious sort of person.

 

how big these 'pages' when going have more single object on each side, spaced apart 61cm!?



More discussions in InDesign Scripting


adobe

Comments