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
stringURL (as in http://www.parkerriver.com) and afile specificationobject to which the script downloads the file. Afile specificationis 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.
Figure 18-2. The dialog window displayed by the new file osaxThe return value for new file is a
file specificationobject. 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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access