Re: To .jpg or not
Re: To .jpg or not
- Subject: Re: To .jpg or not
- From: BJ Terry <email@hidden>
- Date: Sun, 21 Mar 2004 10:34:27 -0800
There are actually several issues with your script. Like Pokemon, I
intend to catch 'em all. First of all, you do not need to tell the
Finder anything when setting up theURL and theFile. Neither of those
call any Finder commands nor do they use any Finder objects. The second
issue is a misspelling of theURL in the second tell block of your
script. Really, I just don't know how this could have occurred. The
third issue is your use of "URL" in the second tell block. The actual
command in URL Access Scripting is called simply "download" and by
adding "URL" you are actually attempting to coerce theURL to a URL
object, which is defined in the Standard Additions. (One curious thing
to note is that the "download" command lists "replacing" as taking
"yes" or "no" instead of simply a boolean. An odd design decision. That
part of your script is correct, though I didn't read it closely enough
in my initial attempts to reconstruct your error.)
Ironically, I never was able to reconstruct your error, the script
always simply failed, or worked for either "test" or "test.jpg". (I
dislike situations like this, in which I am unsure whether to put the
period inside the quotation marks or not. Inside of the quotation marks
it spoils the literal nature of the contained text. Outside, it breaks
the convention that periods come before quotation marks.)
On Mar 19, 2004, at 12:35 AM, Carl Anderson wrote:
tell application "Finder"
set theUrl to "http://webaddress.jpg"
set theFile to (((path to desktop folder) as text)& "test:test.jpg")
end tell
tell application "URL Access Scripting"
with timeout of 60 seconds
try
download URL heUrl to (theFile) replacing yes
display dialog "Download Successful" with icon note
on error
display dialog "Sorry, couldn't download the webpage" with icon 2
end try
end timeout
end tell
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.