forgot that it needed to be used as a number:
c=thisComp.name
parseInt(c.charAt(c.lastIndexOf(“_”)-1),10)
BTW, just recently learned about the various flavors of parseInt so if you are following along at home, make sure to add the ,10 whenever you use parseInt to make sure you pull base 10 numbers which I imagine is what you’ll want 99% of the time..
-Lloyd
https://aescripts.com