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

Beginner question - methods supported?

Explorer ,
Jul 18, 2019 Jul 18, 2019

Copy link to clipboard

Copied

Hi I'm back with another beginner question.

Is there a resource somewhere that lists all the methods and syntaxes and [stuff] that extendscript supports? ... or doesn't support? Does that make sense?

All of the javascript resources I'm using to learn talk about pre and post ES6. And I know that extendscript does not support the latest version of ecma script, but I cant seem to find which version it does support.

As an example, I tried to use a forEach method, and am struggling. I'm not sure if my syntax is wrong, or if I don't have a proper understanding of the method, or if I'm just asking extendscript to do something it cant. And It would really help to eliminate one of these options.

Best,

TOPICS
Scripting

Views

882

Translate

Translate

Report

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
People's Champ ,
Jul 18, 2019 Jul 18, 2019

Copy link to clipboard

Copied

You don't have to look far: Open ESTK, Help > Object Model Viewer. In the top-left corner, beneath where it says Browser, there's a dropdown. Choose "Core Javascript Classes" and you'll see all the supported Javascript properties, methods and objects.

If it isn't there, you can't use it!

Ariel

Votes

Translate

Translate

Report

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 ,
Jul 18, 2019 Jul 18, 2019

Copy link to clipboard

Copied

I tend to use this resource kindly supplied by Gregor Fellenz: https://www.indesignjs.de/extendscriptAPI/indesign-latest/#about.html

If the answer wasn't in my post, perhaps it might be on my blog at colecandoo!

Votes

Translate

Translate

Report

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
Explorer ,
Jul 18, 2019 Jul 18, 2019

Copy link to clipboard

Copied

Oh wow, I never realized that was there. This helps a ton!

Votes

Translate

Translate

Report

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 ,
Jul 18, 2019 Jul 18, 2019

Copy link to clipboard

Copied

Adding to what TᴀW and Colin Flashman wrote, there are two other pdf's as well that you can open from the same menu. The menu items called "Adobe Into to Scripting" and "Javascript Tools Guide CC" should provide you generic details on scripting for Adobe applications like InDesign. These pdf's will cover the topic of generic language features supported by jsx. So would know what is supported and what is not. For each is not supported.

-Manan

Votes

Translate

Translate

Report

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
Guide ,
Jul 18, 2019 Jul 18, 2019

Copy link to clipboard

Copied

Regarding the syntax:

ExtendScript is very close to ECMA-262 3rd edition (1999) mixed with ECMA-357 ECMAScript for XML (E4X, 2005) and a scattered set of extra features and directives (watch/unwatch, operator overloading, $.stack, #targetengine, jsxbin-eval…), not to mention the ScriptUI module which sometimes involves syntactic “sugars” of its own.

The ExtendScript engine (4.5.x for CC, 4.2.x for CS6, 3.92.x for CS4, 3.7.x for CS3…) has been very stable during the last 15 years. Changes (and bugs!) have mostly affected the regular expressions engine, i.e. the RegExp object. The language itself has a few subtle, if not imperceptible, specificities. For example, operator precedence do not fully comply with JS rules  when || (logical OR) is involved. Also, const identifiers are supported for a long time, as well as the for each(val in obj) syntax. Also, we regularly discover new deep bugs, as this one affecting the [[global]].parseInt() method.

A very short list of differences between JS and ES are explained here (in the frame of AfterEffects), but this is only a tiny part of the complete list.

@+

Marc

Votes

Translate

Translate

Report

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
Explorer ,
Jul 18, 2019 Jul 18, 2019

Copy link to clipboard

Copied

LATEST

This is all incredibly helpful as well. I actually saw that page when I was looking on my own for an answer, but I'm so new to all this, I didn't know if that was after effects specific. Because, surely if it applied to ALL of extend script it wouldn't only be explained on the aftereffects page.

Votes

Translate

Translate

Report

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