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

P: [PS Scripting] ExtendScript support for ECMAScript 6th version

Community Beginner ,
Jul 23, 2015 Jul 23, 2015

ExtendScript as it's implemented in Photoshop Scripting engine is compliant to:

- ECMA-262 (version 3)
- EX4 (EcmaScript for XML)

plus other custom stuff like Filesystem management, Reflection interface, operator overloading, etc.
It's a great language, but... the rest of the Javascript world has moved to ECMA-262 version 6 aka ES6 Harmony, while so to speak we're stuck at ES3.

We don't have native support (among the rest) of JSON, Array.indexOf, Promises, Object.create, etc...

It's becoming increasingly difficult to interface with JS libraries, since shims are not always available/functional.

Also, strategically, we're in a cul-de-sac (aka dead end): there hasn't ever been a major language update (besides ScriptUI changes to support different rendering engines over the years), the PS Scripting language cannot not-evolve now that JS seems to have gained a great momentum and it's as lively as it's never been in the past.

My feature request is not to substitute ExtendScript with JS tout-court (since it would mean give up to EX4 and proprietary stuff), but to incorporate the new ES6 syntax and features - give ExtendScript a place in the future.

Thank you very much,

Davide Barranca
---

[weblinks removed by moderator]

 

Idea No status
TOPICS
Actions and scripting , macOS , SDK , Windows
2.1K
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

Adobe Employee , May 12, 2022 May 12, 2022

While it's true that UXP is built on V8 and has a far more up-to-date JavaScript engine than ExtendScript (We're well past only "ES6" these days), it would be disingenuous to say that UXP _implements_ this request, since modern JavaScript also _omits_ E4X and other ExtendScript features as listed in the original request. That is to say, UXP is not a drop-in replacement for ExtendScript, and can't be used as such. Any ExtendScript scripts have to be rewritten to work in UXP, and that can be chall

...
Translate
22 Comments
LEGEND ,
Jul 23, 2015 Jul 23, 2015
I completely agree with Davide. Please add support for this!
Translate
Report
LEGEND ,
Jul 23, 2015 Jul 23, 2015
ES6 would be super useful in PS for us script/extension writers. Please help us make your product better for the users!
Translate
Report
Community Beginner ,
Jul 23, 2015 Jul 23, 2015
Unfortunately I don't have the faintest idea what this is all about since I stopped programming a decade ago. But I know Davide and everything he does is truly reasonable.
Translate
Report
Community Beginner ,
Jul 23, 2015 Jul 23, 2015
🙂 Thank you, from now on I'll ask my wife to call me Davide "reasonable" Barranca!
Translate
Report
Engaged ,
Jul 23, 2015 Jul 23, 2015
+1
Translate
Report
Community Beginner ,
Jul 23, 2015 Jul 23, 2015
My mistake, I should have written 'E4X' (ECMA357) - thanks to @indiscripts for reporting!
Translate
Report
Enthusiast ,
Jul 23, 2015 Jul 23, 2015
I do need this for our workflow optimization!
Translate
Report
LEGEND ,
Jul 23, 2015 Jul 23, 2015
Davide' extensions are critical for mine, and my clients, workflows, I'd love for him to have the widest toolset possible for his work, thanks Davide.
Translate
Report
LEGEND ,
Jul 23, 2015 Jul 23, 2015
Thumbs up, it's very frustrating having to "cut back" on what you know and like is the best way to code JS because it'll not work with ESTK. We have regularly updated Chrome in panels and modern Node.js in Generator, but ESTK is holding all those back.
Translate
Report
Engaged ,
Sep 10, 2015 Sep 10, 2015
Totally agree! I want .forEach() and .map()!
Translate
Report
Participant ,
May 31, 2016 May 31, 2016
Having to play the "is this basic native function supported or not" game is not a fun one. Having to write and/or include my own versions of things like Array.firstIndexOf() is frustrating.
Translate
Report
Guest
Jun 26, 2016 Jun 26, 2016
I support this request! 
An update with ECMAScript 6 features would allow to code cleaner, better, faster, stronger.
Translate
Report
LEGEND ,
Jul 08, 2016 Jul 08, 2016
Voted! Beside this the ToolVM javaScript engine is extremely slow compared to PanelVM's.
Translate
Report
Participant ,
Oct 28, 2016 Oct 28, 2016
+1

ExtendScript needs some love! Otherwise a lot of our work will become useless very soon.
Translate
Report
LEGEND ,
Nov 22, 2016 Nov 22, 2016
Translate
Report
Community Expert ,
Mar 24, 2022 Mar 24, 2022

Given that UXP is not using s the V8 JavaScript engine which supports ES6, this thread should be tagged as implemented, no?

Translate
Report
Community Beginner ,
May 08, 2022 May 08, 2022

OMG, please. Working around with old ECMA is so exausting.

Translate
Report
Community Expert ,
May 12, 2022 May 12, 2022
Translate
Report
Adobe Employee ,
May 12, 2022 May 12, 2022

While it's true that UXP is built on V8 and has a far more up-to-date JavaScript engine than ExtendScript (We're well past only "ES6" these days), it would be disingenuous to say that UXP _implements_ this request, since modern JavaScript also _omits_ E4X and other ExtendScript features as listed in the original request. That is to say, UXP is not a drop-in replacement for ExtendScript, and can't be used as such. Any ExtendScript scripts have to be rewritten to work in UXP, and that can be challenging depending on the feature set of ExtendScript that one used.

 

Given this, the realistic response is as follows:

  • There are no plans to update ExtendScript to support modern JavaScript. ExtendScript will stay at ES3 levels for as long as it is available in a product.
  • Some developers have had success in transpiling from ES5+ to ES3 and having that work in ExtendScript. This is not ideal, but may meet your particular needs. Note that any E4X will get in the way of these transpilers, since they don't understand that syntax.
  • If you want modern JavaScript, UXP is there for you to use. However, the Photoshop API is still being built out, and so you may face some challenges in figuring out how to do certain things. Furthermore, you'll lose the ExtendScript features such as E4X, operator overloading, etc.

 

Given that, I'd close this as "not doing", w/ UXP or transpiling as the suggested workaround. That way we don't set expectations improperly for those not following along w/ UXP closely.

Translate
Report
Community Expert ,
May 12, 2022 May 12, 2022

Thank you very much for this complete explanation, Kerri ! Way over my head, but I'm sure scripters will understand !

Translate
Report
LEGEND ,
May 19, 2022 May 19, 2022

I didn't know she has this forum account. How did you know it - there was no any post of her?

Translate
Report
Community Expert ,
May 20, 2022 May 20, 2022
LATEST

I guessed, and it worked... I could not remember quickly Erin's handle, so I tried hers.

Translate
Report