4 Replies Latest reply on Sep 2, 2012 11:38 PM by Statixx91

    How to move an image?


      Hey guys,


      I just started learning how to script and I'm already here with a problem.


      At work I sometimes need to place some PDF files (+/- 30 pages) into an Indesign document for further work. So now I wanted to write a script that moves the (already placed) PDFs to x=0; y=0 on every Page.

      And here's the problem: The script isn't moving the PDFs, it only moves the image frames.


      Thanks in advance, Michael


      #target InDesign
      var _dok = app.activeDocument;
      var _allPages= _dok.pages;
      for (i = 0; i < _allPages.length; i++)
          var _page = _allPages[i];
              for (k = 0; k < _page.pageItems.length; k++)
                  var _kasten = _page.pageItems[k];
                  var _koordinaten =_kasten.geometricBounds;
                  var _breite = _koordinaten[3] - _koordinaten[1];
                  var _hoehe = _koordinaten[2] - _koordinaten[0];
                  _koordinaten[0] = 0;
                  _koordinaten[1] = 0;
                  _koordinaten[2] = _hoehe;
                  _koordinaten[3] = _breite;
                  _kasten.geometricBounds = _koordinaten;