Skip to main content
Participant
July 23, 2015
Open for Voting

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

  • July 23, 2015
  • 22 replies
  • 2154 views

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]

 

22 replies

PECourtejoie
Community Expert
Community Expert
May 20, 2022

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

Kukurykus
Legend
May 19, 2022

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

PECourtejoie
Community Expert
Community Expert
May 12, 2022

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

Kerri Shotts
Adobe Employee
Adobe Employee
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.

PECourtejoie
Community Expert
Community Expert
May 12, 2022
Participant
May 8, 2022

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

PECourtejoie
Community Expert
Community Expert
March 24, 2022

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

Inspiring
November 22, 2016
JavierAroche
Inspiring
October 28, 2016
+1

ExtendScript needs some love! Otherwise a lot of our work will become useless very soon.
Inspiring
July 8, 2016
Voted! Beside this the ToolVM javaScript engine is extremely slow compared to PanelVM's.