Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions AE ExtendScript: How to access the number of characters typed into an “edittext” GUI box.

  • AE ExtendScript: How to access the number of characters typed into an “edittext” GUI box.

    Posted by Andy Troz on August 5, 2013 at 3:23 pm

    Hi Dan!

    I’ve created a simple GUI “edittext” box that allows 10 characters of user input. Now I’m trying to say “if there’s nothing in the text box, do actionA, however, if there IS something in the text box, do actionB.”

    I’ve included a sample code to show what I’ve tried. I understand that the “.characters” probably refers to the 10 that I assigned to the “edittext” box, so that’s where I’m confused as to how I can check the characters that are manually typed in the “edittext” box.

    Best,
    Andy

    if (myTextInput.characters >= 1){
    do actionA;
    }else{
    do actionB;
    }
    }

    Dan Ebberts replied 13 years, 1 month ago 2 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    August 5, 2013 at 5:31 pm

    You should be able to use either of these:

    if (myTextInput.text.length > 0){

    or,

    if (myTextInput.text != “”){

    Dan

  • Andy Troz

    August 7, 2013 at 7:05 pm

    Dan, do you have a paypal account? I’d love to send you something for all the help you’ve given me!

  • Dan Ebberts

    August 7, 2013 at 7:13 pm

    Glad I could help. There’s a PayPal tip jar on my web site (motionscript.com). Thanks!

    Dan

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy