MACSCRPT Archives

January 2010

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Condense Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Mime-Version:
1.0 (Apple Message framework v936)
Sender:
Macintosh Scripting Systems <[log in to unmask]>
Subject:
From:
Chris Harbinson <[log in to unmask]>
Date:
Fri, 8 Jan 2010 09:13:37 +0000
Content-Transfer-Encoding:
7bit
Content-Type:
text/plain; charset=US-ASCII; format=flowed; delsp=yes
Reply-To:
Macintosh Scripting Systems <[log in to unmask]>
Parts/Attachments:
text/plain (41 lines)
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

ATOM RSS1 RSS2