UXP for ExtendScript Developers
If you're coming to UXP from ExtendScript and the ESTK (ExtendScript ToolKit) or its 64-bit successor, the ExtendScript Debugger, you'll be pleasantly surprised but you'll also have some new things to learn:
Different DOM access#
UXP provides different methods for accessing the Photoshop DOM. See the Photoshop UXP API reference for more information. At present, the entire DOM is not yet supported, but more access is being added with every Photoshop release.
As a workaround until all the significant Photoshop features are accessible via UXP, you can use a feature called batchPlay.
Migration helper for ExtendScript developers#
If you use
executeActionGet often in your code, the ExtendScript batchPlay logger utility can help you migrate your code. Plug the
ps-es-to-uxp jsx code into your ExtendScript project, and it will print out all your
executeActionGet methods in a format suitable for the UXP equivalent API: batchPlay.
ExtendScript Toolkit ("ESTK") was the development environment of choice for many years, and still is for many Windows developers. On macOS, ESTK died a lingering death due to the deprecation of 32-bit code. Recently, ESTK has been replaced by a plugin for Visual Studio Code, a widely-used editor.
prompt() calls. Or you could use the full-featured but complex ScriptUI to create complex dialogs. Moving beyond ExtendScript into CEP, there are more possibilities with panels.
A full introduction to ES6 features and syntax is beyond the scope of this documentation. You can find many websites that discuss ES6 features, including the popular Mozilla Developer Network. Make sure you understand at least these language features, which you will find in UXP code you pick up from around the web:
- "const" and "let" declarations vs "var"
- Promises and asynchronous functions
- Anonymous functions
- Arrow functions
- Template literals
What's Missing in UXP#
UXP provides an HTML interpreter similar to Chromium; it's more limited than a full browser, which means some commonly-used web CSS and HTML idioms don't work. For more information on what does and doesn't work in the UXP HTML environment, see this document.