3 Replies Latest reply on Jan 6, 2011 7:14 AM by stoereee

    [CS5 JS] If insert point at left page use left instructions

    stoereee

      How can I trigger a specific insert point from which page side (left or right) that point is? I want to insert a textframe on the insert point, with different  coordinates for left or right pages:

       

      function side_note (ins_point, s) 
         { 
                 
             if (ins_point == PageSideOptions.leftHand)
      {
         var sidebar = ins_point.textFrames.add (); 
         sidebar.geometricBounds = [0,0,5,65];
         sidebar.appliedObjectStyle = app.activeDocument.objectStyles.item ('sidebar_left'); 
         sidebar.contents = s; 
         sidebar.fit (FitOptions.frameToContent); 
         }
      else
      {
         var sidebar = ins_point.textFrames.add (); 
         sidebar.geometricBounds = [0,0,5,65];
         sidebar.appliedObjectStyle = app.activeDocument.objectStyles.item ('sidebar_right'); 
         sidebar.contents = s; 
         sidebar.fit (FitOptions.frameToContent); 
         }
      
      }
      

       

      Regards, Sjoerd