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

Reading from Website

Guest
May 20, 2011 May 20, 2011

Hello Everyone!

Is it possible to grab the contents of a webpage and store the value into a variable?  We have a script that generates one line of text for a correlating inDesign file on our webserver.  Rather than having to our website and copy/paste the line into their inDesign file, it would be wonderful to automate this task by being able to have a script fetch this line.  Is there any documentation explaining a method to grab the contents of a file (in my case a webpage) or does anyone know how to accomplish something like this?

Thanks in advance!

TOPICS
Scripting
667
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
LEGEND ,
May 21, 2011 May 21, 2011

Yes. See Chapter 6 of the Javascript Tools Guide, which has this example:

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(999999);
  conn.close();
}

[ In CS3 there was an Http object, but you couldn't use it from InDesign anyhow, only Bridge. Anyone know what happened to that? ]

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 ,
May 23, 2011 May 23, 2011

I don't know what happend.

But prevoiuse script work fine in my Indesign CS3 CS4 and CS5 (OSX10.6.6).

Ten.

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
LEGEND ,
May 23, 2011 May 23, 2011

Sorry, are you the same person as the original poster?

Are you saying it doesn't work in CS5.5, or just that you don't know where the Http object went?

The Http object was never present for InDesign, to the best of my knowledge.

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 ,
May 23, 2011 May 23, 2011
LATEST

I'm not orign poster.
Sorry to my self-deceived. As you say, "Http Object" nolonger in Indesign. So we use connecting network, use Socket Object from CS3.

Ten.

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