• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Downloading .csv file via Javascript link
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Downloading .csv file via Javascript link


  • Subject: Re: Downloading .csv file via Javascript link
  • From: Sander Tekelenburg <email@hidden>
  • Date: Fri, 7 Dec 2001 10:52:31 +0100

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

At 18:37 +1100 UTC, on 07-12-2001, Andrew Duncan wrote:

> Hi - I'm trying to AppleScript Netscape Navigator v4.7 on Mac OS 9.1 to
> download a file from a website, or alternatively use the URL Access
> Scripting to do this. The site in question requires a password to be
> entered into a field on the web page and then you can click a Javascript
> link which generates a .csv file that is downloaded.
>
> I can't use Internet Explorer as it just opens the .csv file in the browser
> window; Netscape however just downloads the file immediately.

Explorer is broken. It ignores MIME types. Instead, it only considers the
filename's extension.

> I'm not sure
> if URL Access Scripting can do what I want - this would be my preferred
> method if possible. Does anybody know whether URL Access Scripting can
> download a file that is linked via Javascript?

I would imagine it depends on what exactly the javascript does. If it boils
down to submitting a form, then it should be possible to construct the URL
that the javascript generates and use URLAccess to send that to the server.
(But I don't see why anyone would use javascript to submit a simple form.)

If the javascript does things not possible in AS, it may be necessary to run
it. In that case there would seem to be 2 options:
1) Explorer allows you to execute javascript through AppleScript (do script
"javascript goes here")
2) Javascript OSA may be useful (I have no experience with it). See
<http://www.latenightsw.com/freeware/JavaScriptOSA/>.


HTH


-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBPBCRWusywKfXgqKdEQLsEgCeI4aT6jh2W654nCnsJV7V1qLqL5cAnizU
UGNFA/MGCm1RW/y2R6YTMSB/
=5VUU
-----END PGP SIGNATURE-----
--
Sander Tekelenburg


References: 
 >Downloading .csv file via Javascript link (From: Andrew Duncan <email@hidden>)

  • Prev by Date: Re: "RE: interesting discovery" thread goes FOOM
  • Next by Date: AS Click Counter
  • Previous by thread: Downloading .csv file via Javascript link
  • Next by thread: Re: Downloading .csv file via Javascript link
  • Index(es):
    • Date
    • Thread