1 Reply Latest reply on Apr 29, 2016 1:11 AM by greenrookie

    Script doesn't work

    Streammer

      Hello, I stady scriptin in JS. I had tried to launch this script

       

      var originalUnit = preferences.rulerUnits;

      preferences.rulerUnits = Units.INCHES;

      var docRef = app.documents.add(2, 4)

      var artLayerRef = docRef.artLayers.add();

      artLayerRef.Kind = LayerKind.TEXT;

      var textItemRef = artLayerRef.textItem;

      textItemRef.contents = "Hello, World";

      docRef = null;

      artLayerRef = null;

      textItemRef = null;

       

      On the sixth row ( var textItemRef = artLayerRef.textItem;)  ESTK show this : "This layer is not a text layer."

      I tried to launch in Photoshop CS6 (64 bit) and CC 2015 (64 bit).

      What the problem?

        • 1. Re: Script doesn't work
          greenrookie Level 3

          Try this.

           

          var originalUnit = preferences.rulerUnits;

          preferences.rulerUnits = Units.INCHES;

          var docRef = app.documents.add(2, 4)

          var artLayerRef = docRef.artLayers.add();

          artLayerRef.kind = LayerKind.TEXT;

          artLayerRef.textItem.contents = "Hello, World";

          docRef = null;

          artLayerRef = null;

          textItemRef = null;

           

          greenrookie