FORUMS: list search recent posts

ExtendScript AE: Identifying pieces of a string in an "edittext" box.

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Andy Troz
ExtendScript AE: Identifying pieces of a string in an "edittext" box.
on Aug 8, 2013 at 12:00:06 am

This may be a little obscure, but I'm trying to achieve the following:

var ab = doThis;
var cd = doThat;

If a user types a single string of "abcd" into my "edittext" box, is there a way that I can identify the "ab" and "cd" separately?

Best,
Andy.


Return to posts index

Dan Ebberts
Re: ExtendScript AE: Identifying pieces of a string in an "edittext" box.
on Aug 8, 2013 at 12:25:32 am

You can use indexOf() to detect the presence of a specific substring within a string. For example:

if (myText.indexOf("ab") > -1) alert("Found 'ab'");

There may be better ways--it depends on the range of possible formatting of your input text.

Dan



Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]