HTTP socket, without using bridge

Discussion of Photoshop Scripting, Photoshop Actions and Photoshop Automation in General

Moderators: Tom, Kukurykus

rasoetan

HTTP socket, without using bridge

Post by rasoetan »

Hello,

How difficult will it be to modify this script to read the output of a script. Basically, rather than read the image file in this example, the script calls a php or html script somewhere on the web, the called script then returns some text. The returned text is then piped back to the calling script.

I'm easily able to do this with XML programming in javascript, but unfortunately, PS javascript does not seem to understand xml.

Thanks,
Raphael

Professional AI Audio Generation within Adobe Premiere Pro - Download Free Plugin here

xbytor

HTTP socket, without using bridge

Post by xbytor »

It should work almost as is. Construct a URL. Make the request as is done ine httpGetFile. Instead of writing the 'reply' to a file, just return it as a string.
Or do a 'return new XML(reply);' if you want to handle it as an XML object.

PS JS does support E4X. I can't comment on how good its implementation is as compared to other environments because it's the only one I'm familiar with at the moment.

-X
rasoetan

HTTP socket, without using bridge

Post by rasoetan »

x,

Thanks for the response. Do you have any examples at hand of E4x being used in Photoshop js to communicate with a php script on the internet?

Thanks,
Raphael
xbytor

HTTP socket, without using bridge

Post by xbytor »

rasoetan wrote:Do you have any examples at hand of E4x being used in Photoshop js to communicate with a php script on the internet?

Nope. E4X is E4X whether it's used for manipulating XMP data in PS or working with XML data from a web server. Try google for examples. However, the HTTP request and response bits will be similar to what has been posted in this thread.

-X
rasoetan

HTTP socket, without using bridge

Post by rasoetan »

Thanks. I do have it working now.

Raphael