I'm having a strange AppleScript issue, and can't seem to figure out the underlying cause, or a solution. I'm trying to download files with a process that mimics the one below. This code fails for me, reporting "URL Access Scripting got an error: Can’t make some data into the expected type." number -1700 to item"
If I remove 3 characters from the local path name (and it doesn't seem to matter which 3), then it runs fine. If I only remove 2 characters, it doesn't throw an error, but the file it downloads is a corrupted JPG. I tried doing the same with curl in a "do shell script" line, and it seemed to fail too for any file name length, albeit silently (returning ""
). What's causing this, and what can I do about it?
tell application "URL Access Scripting"
download "http://interfacelift.com/wallpaper_beta/grab/02331_veiledinclouds_2560x1600.jpg" to "/Users/abc/Downloads/02331_veiledinclouds_2560x1600.jpg"
end tell