Name

URL Access Scripting

Synopsis

The following descriptions detail the available URL Access commands (download and upload ) available for scripting.

Dictionary commands

download

The download command downloads a file using either FTP or HTTP to the disk of the machine running the script. The web file can then be viewed with a browser locally. Any images, however, are not downloaded with the web page using HTTP, so you would have to download the images separately using the download command. download takes two required parameters: a string URL (as in http://www.parkerriver.com) and a file specification object to which the script downloads the file. A file specification is an AppleScript data type that represents the name and location of a file before it is actually saved to the hard disk. In other words, you can create a new file with the new file scripting addition, which will have the operating system reserve a unique path for the new file. The new file osax displays a dialog box requesting that the user choose a location and name for the new file. Figure 18-2 shows this new file dialog window.

The dialog window displayed by the new file osax
Figure 18-2. The dialog window displayed by the new file osax

The return value for new file is a file specification object. You can then download a file to this reserved file path and an actual file is saved to the hard disk with the prior specified location and name. You have to enclose ...

Get AppleScript in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.