1 Reply Latest reply on May 9, 2011 12:41 PM by Haakenlid

    Can script dup Image with photoshop path

    ask4forhelp

      VBscript is preferred, Thankyou.

       

      I would like script to do because speed is fast.


      duplicate current selection image

      bring to front

      remove all effects

      take photoshop path

      fit to size


      Which on-hand shortcut will be:

      CTRL+ALT+U, 1 {tab} 0 {tab} 0 {tab} {enter}

      CTRL+SHIFT+]

      ALT+O, E, A

      CTRL+ALT+SHIFT+K, ALT+Y, {DNArrow}{DNArrow} {enter}

      ALT+O, F, F


      Manual Step not hard to do, but script make faster.

       

      If using SendKeys, Need to Sleep few seconds for waiting dialog, but fail to use WSH object to sleep.

        • 1. Re: Can script dup Image with photoshop path
          Haakenlid Level 3

          Don't know VB, but here is how to do it with javascript. Should not be too difficult to convert to VB if you know it.

           

          var myImage = app.selection[0];
          
          //duplicate current selection image
          myImage.duplicate();
          
          // bring to front
          myImage.bringToFront();
          
          //remove all effects (I do this by applying object style [none])
          myImage.appliedObjectStyle = app.activeDocument.objectStyles.itemByName("[None]");
          myImage.clearObjectStyleOverrides();
          
          //take photoshop path (I assume there is just one path in the file)
          myImage.images[0].clippingPath.clippingType=ClippingPathType.PHOTOSHOP_PATH;
          
          //fit to size (I assume you mean "Fit frame to content")
          myImage.fit(FitOptions.FRAME_TO_CONTENT);