Using XMLHttpRequest in Photoshop script

I tried to request information from an API in JavaScript using this, but ExtendScript keeps giving me an error saying that...

var xhr = new XMLHttpRequest();

.. has no constructor.

Is it possible to get rid of it within Photoshop / is there any workaround?

Hello

the answer you get is not something fancy, just a regular string.

Try this:

$.writeln(reply.substr(reply.indexOf("\r\n\r\n")+4));

(he finds "\r\n\r\n" in response and start playback of the end of it until the end of the string)

I hope this helps!

Davide

UPDATE (removed unnecessary "this." in the code)

Tags: Photoshop

Similar Questions

Maybe you are looking for