5 Replies Latest reply on Nov 8, 2016 10:23 AM by donaldc65313512

    Unterminated String Constant...


      I'm trying to create an expression for the X position of a layer containing an image that hooks it to a slider control in a Null.

      I keep getting an "Unterminated String Constant" error for anything that uses a name.


      thisComp.layer("Carousel Controls").effect("Slider Control")("Slider"); —Gives the error

      thisComp.layer(1).effect("Slider Control")("Slider"); —Works, but isn't preferable


      If I change the name of the slider control to Expand:

      thisComp.layer(1).effect("Expand")("Slider"); —Gives the error


      I've done this in the past and it's a pretty straightforward thing I'm attempting.

        • 1. Re: Unterminated String Constant...
          Dan Ebberts Level 5

          Both your examples work for me. There must be something else going on.



          • 2. Re: Unterminated String Constant...
            Mylenium Most Valuable Participant

            What system? What language? You need to be more specific. This sounds like a Unicode issue.



            • 3. Re: Unterminated String Constant...
              Pyrosousa Level 1

              I think I am having the same problem, here it is in more detail:


              OS: macOS Sierra 10.12 (though i was also having this issue on El Cap before upgrading to Sierra)

              Computer: MacBook Pro (Retina, 15-inch, Mid 2015)

              Processor: 2.5 GHz Intel Core i7

              RAM: 16 GB 1600 MHz DDR3

              After Effects 2015.3 Release

              After Effects Version:


              This happens in any instance that involves renaming a layer, but I will be specific in this example since I think it illustrates the problem very well.


              If you create a new Null and a new empty text layer. Add a Checkbox Control to the Null. Add an expression to the source text of the Text layer, and pick-whip the checkbox control. It will now show either a 1 or a 0 depending if the checkbox is checked or not. Exactly what you'd expect.


              Now if you change the name of the null object, it will update the expression to the new name, however it will add a line break in the layer name, which breaks the expression. Even if you correct the line break error, or pick-whip the Checkbox Control again, the expression still doesn't work, saying the layer you are looking for doesn't exist. It seems that when you rename the text layer it is adding that line break.


              Solution: When renaming a layer, just press backspace once, before typing your new name. That seems to fix the problem by deleting the line break that is being added. I just submitted a bug report to Adobe, hoping it gets fixed.


              My Project File:


              2 people found this helpful
              • 4. Re: Unterminated String Constant...

                I've been having the same problem.  Your trick of hitting backspace before typing anything works!  This bug is extremely annoying though.

                • 5. Re: Unterminated String Constant...

                  I have the exact same problem on all versions of AE except 2017. Started with upgrading to MacOS Sierra 10.12.1.

                  Pyrosousa's backspace (delete) workaround works for me as well.