2 Replies Latest reply on May 2, 2013 5:25 AM by Bill joy

    How remove image which is attach with cursor when place image ?

    Bill joy Level 1

      Hi Experts

       

      My problem is like this :

      I want place image in a text box

      File(menu)-->place....-->(Dialog open then Select Image file then click on open)->then image is attach  with cursor. (I do not click on .indd open screen).

      Now I run the script from ExtendedTool Kit

       

      #target indesign

      var myDocument=app.activeDocument;

      var myTextFrame=myDocument.spreads.item(0).textFrames.firstItem();

      $.sleep(2000);

      myTextFrame.place(File("/C/DOCUME~1/ADMINI~1/LOCALS~1/Temp/temp.jpg")) ;

      $.sleep(2000);

      var graphic=myTextFrame.allGraphics[0];

      graphic.select(SelectionOptions.REPLACE_WITH);

      graphic.geometricBounds =["-47.853527","-157.370275","1231.018230","709.576702"];

       

      When this script run then it place the image which I am select from File(menu)-->place....-->(Dialog open then Select Image file then click on open).

       

      Not from the path "/C/DOCUME~1/ADMINI~1/LOCALS~1/Temp/temp.jpg"

       

      This is the problem to place image. I want to place image from path "/C/DOCUME~1/ADMINI~1/LOCALS~1/Temp/temp.jpg"

       

      So before place image using above script I want to clear the attach image with cursor using script.

      Because I am placing multiple image in my file using script So in place of my second image first image is place and so there is repetation of first image and second image is miss.

       

       

      Is there is solution of this problem ?

      How remove image which is already attach with cursor  using script?

       

      Thanks.

        • 1. Re: How remove image which is attach with cursor when place image ?
          Muppet Mark Level 5

          Im not at all sure what you want here… If your cursor already has an image then its in the place gun…?

           

          abortPlaceGun() // May well be what you are looking for but I've never scripted this before…

          1 person found this helpful
          • 2. Re: How remove image which is attach with cursor when place image ?
            Bill joy Level 1

            Thanks Mark for reply

             

            First I want to tell you my problem.

            First I put my image .jpg  in " C/DOCUME~1/ADMINI~1/LOCALS~1/Temp/InDtemp/ " folder  and give name it temp.jpg. Then place in .indd document using script. Then delete this image.

            I repeat this process for all image but some time in place of second image, first image is place

            while in " C/DOCUME~1/ADMINI~1/LOCALS~1/Temp/InDtemp/ " folder the first image is not present. How solve this problem ?

             

            I try :

             

            #target indesign

            var myDocument=app.activeDocument;

            var myPlaceGun =myDocument.placeGuns();

            myPlaceGun.abortPlaceGun();

            var myTextFrame=myDocument.spreads.item(0).textFrames.firstItem();

            myTextFrame.place(File("/C/DOCUME~1/ADMINI~1/LOCALS~1/Temp/InDtemp/temp.jpg"));

             

            but it place some time the above image which is place before this "C/DOCUME~1/ADMINI~1/LOCALS~1/Temp/InDtemp/temp.jpg" image

             

            Thanks