I want to write a script that searches a web page for an updated file, then downloading it when detected. There is no command I have found that does this, accept Automator's download URL function, that I believe just gets the HTML, not the file.

Tell me if I am wrong or if AppleScript can do such a task?

P.S. I would not like to use any Internet libraries.

2 Answers 2


You have a couple options here, oh the power of a mac!

Option 1:

Use the curl command, documented here.

I would use AppleScript to run the Curl command and any other command you need to run in order to fetch the file you need to analyze, process it to check for the updated file, and then use the curl command again to download the updated file.

If you don't want to use AppleScript, Automator is another option.

Option 2:

Using Applescript, you could have it trigger another script written in perl, php, or the language of your liking, which could be written to do the same fetching, analysis, and fetching of the updated file. This will provide you the flexibility to write in whatever language you choose based on your comfort level with that language.

An example of writing an AppleScript to trigger another file could be:

do shell script "php ~/Library/Scripts/MyCustomScript.php"

For either option, if you write an AppleScript you can use a program like FastScripts (Also available in the Mac App Store), which adds an icon to the menu bar through which you can easily access your AppleScripts to execute them, but it also provides the added benefit of being able to assign keyboard shortcuts to your AppleScript to trigger them even faster.


Use wget

Applescript can also do this easily.

I would use the wget command with a bash script and run it using the the osascript -e command.

  • 1
    That would work, but are there any ways to do that without any libraries?
    – APCoding
    Commented Dec 23, 2013 at 16:48
  • Not sure, but there are a couple of people on here who may know a way. Also if you found the answer useful, or helpful I generally upvote it ;-)
    – Deesbek
    Commented Dec 23, 2013 at 16:53
  • I would, but I don't have enough reputation. I just started today
    – APCoding
    Commented Dec 23, 2013 at 17:11
  • I already upvoted your question, 4 more rep points and you will be able to upvote. If you answer a question or edit somebody elses post and get it approved you will get the required reputation.
    – Deesbek
    Commented Dec 23, 2013 at 17:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .