Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6577219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:36:29+00:00 2026-05-25T15:36:29+00:00

I wrote a script that downloads files from an Http server, but the results

  • 0

I wrote a script that downloads files from an Http server, but the results are very sporadic. If I run it three times in a row, it might work twice and error once or not work at all and return different errors.

Some of the errors I am getting are:

Error with downloading target URL (-609)
Url Access Scripting got an error: Connection is invalid.

Error with downloading target URL (-31040)
URL Access Scripting got an error: An error of type -31040 has occurred.

try
    set theFileURL to "http://ftp2.nflfilmstv.com/filmsint/ftp-inet/Team/110915_game_preview_phi_atl_3200k.mp4" as text

    set TID to AppleScript's text item delimiters
    set AppleScript's text item delimiters to "/"
    set theFile to text item -1 of theFileURL
    set AppleScript's text item delimiters to TID

    set theFilePath to "Macintosh HD:Users:rgilkes:Desktop:" & theFile as text

    tell application "URL Access Scripting" to download theFileURL to file theFilePath with progress
    on error ErrorMessage number ErrorNumber
        display alert "Error with downloading target URL (" & ErrorNumber & ")" message ErrorMessage
end try

Is there a better way to download files via AppleScript or is my coding bad?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T15:36:30+00:00Added an answer on May 25, 2026 at 3:36 pm

    Ahhh, thanks for the preview! I’m originally a Philadelphian and still passionate about Philly sports. I hope I’m not helping a Falcons fan. At least not this week! 😉

    Anyway your code looks fine although URLAccessScripting is not the most reliable way to download. Actually as of 10.7 it’s no longer even is included with the OS. Curl is an alternative and usually stable. You won’t get a progress window with it though. Try this. See if it’s more stable. It will tell you when it’s finished.

    set theFileURL to "http://ftp2.nflfilmstv.com/filmsint/ftp-inet/Team/110915_game_preview_phi_atl_3200k.mp4"
    
    set {TID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, "/"}
    set theFile to text item -1 of theFileURL
    set AppleScript's text item delimiters to TID
    
    set theFilePath to (path to desktop as text) & theFile
    
    try
        do shell script "curl " & quoted form of theFileURL & " -o " & quoted form of POSIX path of theFilePath
        display dialog "The download is finished!" buttons {"OK"} default button 1 with icon note giving up after 5
    on error theError
        display dialog "Error downloading the file:" & return & theFile & return & return & theError buttons {"OK"} default button 1 with icon 0 giving up after 5
    end try
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to write a script that will download files from an FTP server.
I want to write a script that will download zip files from a given
Right now I'm trying to serve CSS and JS files from a server that
I'm writing a script that has to download several files from the www. To
I wrote a script that uses xcodebuild to generate an AdHoc build of an
I wrote a Python script that does some task to generate, and then keep
This is a crude korn shell script that someone else wrote. I don't know
I have a Perl script I wrote for my own personal use that fetches
I wrote a short bash script to complete a task that involves creating a
I have a Python script I recently wrote that I call using the command

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.