Skip to main content
Jan 18, 2017 8:15 PM UTC
Answered

Need help using Socket

I need to connect to a webpage that contains a list of documents. Need to grab the next document ID available by reading the top most document.

Can somebody point in the right direction?

I tried the script that comes in the manual but something is not working right.

Thanks.

This topic is closed to new replies. Start a new post to keep the conversation going.
Russ WardCorrect answer
Legend
Jan 19, 2017 1:45 PM UTC

Hi funsekon,

I have a sample script that opens a socket connection and retrieves data from an internet site. I don't know exactly what "grab the next document ID" means, but this sample will at least show how to use the Socket object. Look at script 10.02.

FrameMaker ExtendScript Samples - West Street Consulting

Russ

4 replies

Russ WardCorrect answer
Legend
Jan 19, 2017 1:45 PM UTC

Hi funsekon,

I have a sample script that opens a socket connection and retrieves data from an internet site. I don't know exactly what "grab the next document ID" means, but this sample will at least show how to use the Socket object. Look at script 10.02.

FrameMaker ExtendScript Samples - West Street Consulting

Russ

Translate
Jan 19, 2017 2:03 PM UTC

Thanks Russ,

Your script is very helpful to understand the process. Seems like my issue may be the firewall blocking access.

Regards,

funsekon

Translate
4everJang
Legend
Jan 18, 2017 9:09 PM UTC

Which script in the manual are you referring to?

Translate
Jan 19, 2017 2:01 PM UTC

reply = "";

conn = new Socket();

// access Adobe’s home page

if (conn.open ("www.adobe.com:80")) {

// send a HTTP GET request

conn.write ("GET /index.html HTTP/1.0\n\n");

// and read the server’s reply

reply = conn.read(99); //999999

conn.close();

}

Translate