Skip to main content
Participating Frequently
August 16, 2011
Question

[CS5][JSX] File from the web?

  • August 16, 2011
  • 1 reply
  • 367 views

Is it possible to use a file from the web?

For instance I have an xsl file I want to use that is at a domain:

http://www.someserver.net/myxsl.xsl

If I use File('http://www.someserver.net/myxsl.xsl') it tries to start searching for 'http://www.someserver.net/myxsl.xsl' from the scripts path:

C:\Program Files\Adobe\Adobe InDesign CS5\Scripts\XHTML for Digital Editions\http:\someserver.net\myxml.xsl

which does not exist. If I use a string it simply says

""http://www.someserver.net/myxsl.xsl""

does not exist (not sure why quotes are doubled around it).

The error is thrown when I go to open the XML file with the transform variable:

cDoc.xmlImportPreferences.allowTransform = true;

cDoc.xmlImportPreferences.transformFilename = defaultPathImportXSL;

cDoc.importXML( XMLFilePath );

defaultPathImportXSL is the variable contianing the path to to the XSL file (wrapped in File() or not -- this is the variable that is not found).

XMLFilePath is the variable contianing the path to the XML file which works (can be found).

Is there a way to use a web URL as a usable file in InDesign?

This topic has been closed for replies.

1 reply

John Hawkinson
Inspiring
August 17, 2011

Not directly, no.

You can download the file into a temporary directory and use that.

The easiest way is to shell out to an external program -- what OS are you using?

The harder way would be to do the http GET request in Javascript. It's a little more self-contained but probably not worthwhile.