By way of example, I converted the previous snippet into this, which runs 
on my machine in Script Editor. Hopefully it will work in yours too...

   -- Brian Johnson


set this_url to "http://www.apple.com/index.html"
set local_filepath to (path to desktop) as string
set local_filepath to local_filepath & "a.b"

display dialog local_filepath

with timeout of 100 seconds
 	tell application "URL Access Scripting"
 		set x to download this_url to file (local_filepath)
 			replacing yes without progress and unpacking
 	end tell
end timeout