Open Url, save htm file to desktop

Dear people,

I’ve serached and searched…and couldn’t find :(. I’m looking for a simple AppleScript that will open Safari, open a url and save then de whole site (example:http://192.168.0.12/index.html) to my desktop.

I can open safari with the url :slight_smile: but it won’t save the page to my desktop. Can anybody help me please?

Kind regards,

Michiel

Well this isn’t exactly what you asked for, as it doesn’t use Safari (or any web browser for that matter), but it works (and is faster than using a browser anyhow). It’s code in the rough, but should give you an idea on how to go about it:

set theURL to "http://192.168.0.12/index.html"
set theFileName to "index.html"
do shell script "curl " & theURL & " -o ${HOME}/Desktop/" & quoted form of theFileName

This will grab a single page and save it to a file on your Desktop. It wasn’t entirely clear to me if that’s what you wanted, or if you want to spider a site. If you want to spider, it can still be done, but perhaps with wget (which is not part of MacOS X anymore) instead of curl. Do a Google using keywords like “spider, curl, wget.” Also, iCab can spider a site for you, and may be all you need. Hope this helps.

Hi,

Thank you for your reply, but i found something and it works great for me.

Kind regards,

Michiel

tell application “URL Access Scripting”
set the temporaryFile to “/Users/michieltersteege/desktop/router/router.htm”
activate
download “http://192.168.0.1/st_poe.htm” to temporaryFile without progress
end tell

Rainy Day,

Works great for downloading streaming and saving them.
Found it works great for that.

Krazay :lol: