Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

Clipping Path On Script

Return to Member Forum

  • Author
    Posts
    • #115651

      This script allows you to turn on the Photoshop Path to all images in a document. Seems to work great except when there is other files linked with without a clipping path layer, such as an Ai logo file or csv data source. Can anyone help me revise so it only selects jpg and psd files instead of all linked items?

      app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;
      app.doScript(resetClippingPath, ScriptLanguage.JAVASCRIPT, [], UndoModes.ENTIRE_SCRIPT, “Clipping Path On – NEW”)

      function resetClippingPath(){
      var allOpenDocs = app.documents;
      for(var m=0;m<allOpenDocs.length;m++){
      var d=allOpenDocs[m];
      var linksIDs = d.links.everyItem().id;
      for(var n=0;n<linksIDs.length;n++){
      try{
      d.links.itemByID(linksIDs[n]).parent.parent.graphics[0].clippingPath.clippingType = ClippingPathType.PHOTOSHOP_PATH;
      }catch(e){};

      };

      };

      };

    • #115789

      SOLVED

      app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;
      app.doScript(resetClippingPath, ScriptLanguage.JAVASCRIPT, [], UndoModes.ENTIRE_SCRIPT, “Clipping Path On – NEW”)

      function resetClippingPath(){
      var allOpenDocs = app.documents;
      for(var m=0;m<allOpenDocs.length;m++){
      var d=allOpenDocs[m];
      var linksIDs = d.links.everyItem().id;
      for(var n=0;n<linksIDs.length;n++){
      try{
      d.links.itemByID(linksIDs[n]).parent.parent.images[0].clippingPath.clippingType = ClippingPathType.PHOTOSHOP_PATH;
      }catch(e){};

      };

      };

      };

    • #14324060

      Hi Kisten,

      I would love to use this on both .eps and psd files. I am getting a JavaScript error:

      Error Number: 8
      Error String: Syntax error

      Engine: main
      File: ~Clipping Paths On.jsx
      Line 2
      Source: app.doScript(resetClippingPath, ScriptLanguage.JAVASCRIPT, [], UndoModes.ENTIRE_Script, “ClippingPath On – NEW”)
      Offending Text: ”

      What am I doing wrong? :)

      Thanks,
      Terre

    • #14324033

      Hi again Kirsten,

      Can you help me with creating a script that allows one to select a number of .eps and .psd files with the Direct Selection tool (white arrow) (many items can be selected by pressing A, then Shift + Command); then activating a PhotoShop path (as one would if Shift + Option + Command + K were pressed and then a silo path was selected.

      After the silo is activated, I want the items to remain selected with the Direct Selection tool (reddish brown silos highlighted) and apply an Object Style to all items?

      And that is all that I need the script to do.

      Appreciatively,
      Terre

Viewing 3 reply threads
  • You must be logged in to reply to this topic.
Forum Ads