[CS5 Server/JSX] allGraphics parent geometricBounds not working on InDesign Server

Advertisement
Hi,
The following script works fine on InDesign Desktop CS5:
g = app.activeDocument.allGraphics;
for (i=0; i<g.length; i++)
g[i].parent.geometricBounds = [0,0,"150mm","150mm"];
g[i].fit(FitOptions.PROPORTIONALLY);
g[i].parent.fit (FitOptions.FRAME_TO_CONTENT);      
When I run the script for InDesign Sever I get the following error:
Error Number 30614
Invalid object for this request,
g[i].parent.geometricBounds = [0,0,"150mm","150mm"];
Why does .parent not work on the server?
Advertisement

Replay

g = myDocument.allGraphics;
for (i=0; i<g.length; i++)
g[i].parent.geometricBounds = [0,0,"150mm","150mm"];
g[i].fit(FitOptions.PROPORTIONALLY);
g[i].parent.fit (FitOptions.FRAME_TO_CONTENT); 
if(myDocument.textPreferences.smartTextReflow)
      vDoc.recompose();
The solution!
Recompose() to automatically insert pages