Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects How to put ” try{}catch{} ” In Expression By Script

  • How to put ” try{}catch{} ” In Expression By Script

    Posted by Supak Suksawat on August 22, 2021 at 4:19 pm

    layers[i].Effects.addProperty(“CC Bend It”)(“Strat”).expression=’try{

    value+transform.position;}catch(err){

    value;

    }’

    I want put try and catch too expression but it error

    Walter Soyka replied 4 years, 9 months ago 2 Members · 1 Reply
  • 1 Reply
  • Walter Soyka

    August 22, 2021 at 7:09 pm

    There are two problems in your code:

    1) The property name should be “Start”, not “Strat”.

    2) Multi-line strings need to be escaped with a backslash.

    This should work better:

    layers[i].Effects.addProperty("CC Bend It")("Start").expression = 'try{ \

    value+transform.position; \

    }catch(err){ \

    value;}';

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