I have been converting an old Quark AppleScript, which converts all
instances of sterling in a document into euros, into JavaScript for
InDesign.
It does the job encouragingly briskly.
However, up to now I have been using an exchange rate, cut and pasted
from the ECB website.
When it came to getting the rate via scripting I ran into problems. I
looked up URL Access Scripting in Script Debugger's dictionary and
opted for the display as JavaScript option...
var result = download(param, to, replacing, unpacking, progress,
form_data, directory_listing, download_directory, authentication);
... looked plausible enough.
So I got stuck in an kept on getting "expected )", so brackets were
inserted until the ExtendScript Toolkit's syntax checker declared no
errors.
var result = download(param ('www.ecb.int/rss/fxref-gbp.html'), to
('Macintosh HD/Applications/Adobe InDesign CS3/Scripts/EuroRate.txt'),
replacing (true));
However when I ran it, I was informed that "download is not a
function". Presumably some JavaScript equivalent of "Tell URL Access
Scripting..." is required.
When you look up "JavaScript" and "URL Access" on Google you get
literally thousands of hits, many of which encouraging contain the
word FREE, but which turn out to mean "FREE" to peruse a price list.
On one site I was offered an MP4 of calming music, maybe what I
needed, but not what I was looking for!
Sorry for bothering you with this novice JavaScripter stuff... In
addition to any help on the problem in hand, I'd be glad to be told of
any source where tyros like myself can find simple instruction./examples
|