Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Broken Expressions After Switching Settings from ExtendScript to JavaScript

Community Beginner ,
Jan 20, 2022 Jan 20, 2022

I pray there's a good solution to this! — Most of the expressions in my project file stopped working when I switched my AE project settings from ExtendScript to JavaScript. What are good ways to go about converting these broken expressions to be compatible with Javascript? Is there a script that does that??

 

This project file has grown over the past couple years to be a fairly large and important collection of comps and expressions used to mogrt templates.  It would be a serious pain / impossibility to re-write. For now, I am just turning the setting back to ExtendScript.

 

Actual advice on a realitic future plan on how to handle this important project file would be most appreciated! Also, I'm about to upgrade to CC 2022. Anyone know if that will cause issues with the expressions if I keep the settings on "ExtendScript"?

 

Thanks in advance ❤️

 

 

TOPICS
Error or problem , Expressions
355
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jan 21, 2022 Jan 21, 2022

Mylenium's tone isn't always ideal, but he's correct. The old engine allowed for looser syntax that the new one doesn't. You can see the full list of updates here. 

If you're planning to continue using this same project, you probably can continue using the Extendscript engine for the forseeable future, but I'd recommend updating it for performance, future-proofing, insurance for other users, etc., as well as extra capabilities you'll get from the more modern expressions engine.

With one notable

...
Translate
LEGEND ,
Jan 21, 2022 Jan 21, 2022

Not really the answer you want to hear, but the solution really is to fix the sloppy expressions. There is no script or magic "fix it" function for this, given that implementing such a thing itself would be a major undertaking, given that of course there would be millions of combinations and scenarios. That's just how it is. A little more time, care and attention spent back then apparently now could save a lot of trouble. It's not that people weren't encouraged to write proper code, it was just never enforced because the AE engine would make certain assumptions...

 

Mylenium

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 21, 2022 Jan 21, 2022

Thank you for your reply.  Also, I encourage you and everyone else on this forum to Be nice and Try not to lose the beginners mind.

 

Its discouraging to describe someone's work as sloppy because the expressions were written in the previous syntex. When learning expressions from online tutorials, its not immediatly clear that you may be using extendscript and not javascript or why you should even know the difference. Especially if the code works!

 

This forum is very helpful but I also find it to can be somewhat mean or judgmental especially when people come here when they are really trying hard to learn or figure things out. Thank you all again for taking time to post replies. 

 

 

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 21, 2022 Jan 21, 2022

Mylenium's tone isn't always ideal, but he's correct. The old engine allowed for looser syntax that the new one doesn't. You can see the full list of updates here. 

If you're planning to continue using this same project, you probably can continue using the Extendscript engine for the forseeable future, but I'd recommend updating it for performance, future-proofing, insurance for other users, etc., as well as extra capabilities you'll get from the more modern expressions engine.

With one notable exception, most of the changes probably aren't noticeable to the average user, unless you had some really heavy code involved. If/then statements would be the main place you'll see this, and those get used frequently in a Mogrt setup.

The new engine requires curly braces, so if you have expressions that look like:

if (property == 1) then 0 else 100

You just need to update them to look like:
if (property == 1) then {0} else {100}

 

I would try saving a copy of your project, update to the new engine, and start chasing down the broken expressions. If you find stuff more complex than the above, I'm sure we'll be happy to help solve it! 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 28, 2022 Jan 28, 2022
LATEST

Thank you for helping me understand the path forward. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines