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

Poor support for Javascript String functions in ExtendScript?

Contributor ,
Jul 08, 2016 Jul 08, 2016

The differences between JS and JSX is really annoying when developing panels, as some things work for one language and not for the other.
I just noticed that the endsWith() -string function doesn't work in JSX. I'm trying to check if a layer name ends with a special character, like this:

alert("lolk_".endsWith("_"));

This will halt script execution. Cmon! Do I really need to use a regex for super simple things like this? It's ridiculus!

TOPICS
Actions and scripting
821
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 , Jul 08, 2016 Jul 08, 2016
Translate
Adobe
Community Expert ,
Jul 08, 2016 Jul 08, 2016
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
Contributor ,
Jul 08, 2016 Jul 08, 2016

Voted!

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 ,
Jul 08, 2016 Jul 08, 2016

But you probably noticed that the number of votes is not particularly large for Photoshop standards so …

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
Advocate ,
Jul 08, 2016 Jul 08, 2016
LATEST

I wouldn't certainly hold my breath waiting for modern JS to be implemented in ExtendScript (my bet is that we'll never get there) – you're better off using shims. There's also a new project that you might want to try here.

Davide

---

HTML Panels Development Course

http://htmlpanelsbook.com

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