AppleScripting Fetch to download files

i have what i think should be a simple solution.

i need to use applescript to tell fetch to daily download files from my web server. i have no idea how to do this. i have downloaded the applescript dictionary for fetch, but i still don’t know how to do it. can anyone help me? thanks!

If I recall correctly, Fetch is recordable. If you can record a basic script and post it here (minus sensitive info such as passwords), it shouldn’t be difficult to optimize the code and make the script work as desired.

To record a script, open a new window in Script Editor and press the record button. Now switch to Fetch and go through the motions required to perform your task. When finished, go back to Script Editor, press the stop button and compile the script.

– Rob

wow, who knew?! that’s awesome. it worked.

now i just have to figure out how to make it do it daily. i’ve heard of crontab, but that has always seemed tricky and delicate. are there any other ways to schedule this new applescript application?

thanks!

If you have iCal 1.5.2, you can use it to run scripts on a schedule as long as the computer is not turned off or asleep when the script needs to run. I use iBeeZz for scripts that need to run when the computer is asleep, but a search at MacUpdate, MacShareware.net or VersionTracker should reveal some of the other script schedulers.

– Rob

You should take a look at the excellent MacScripter FAQ pages that the folks here have put together (way to go jj et. al.!). This one, in particular, deals with scheduling the execution of a script:

[url=http://macscripter.net/faq/general.php?id=P46]http://macscripter.net/faq/general.php?id=P46[/url]

Jon

ok,thanks for showing me that faq. half of the links are dead and the other half point to outdated products. so, it looks like i can use the script that was offered below, but would love some advice on how to alter it. i will make my applescript a ‘stay open’ application and i always leave the computer on. so, how can i edit the below script to perform a certain function daily? esp if i always leave my computer turned on? thanks!

global runAtTheseTimes

on run
set runAtTheseTimes to (current date) + 2 * hours
end run

on idle
if (current date) ≥ runAtTheseTimes then
display dialog “We are 2 hour running! Now quit!”
quit
end if
return 30 – > check every 30 seconds
end idle

rob,

i missed your post somehow. i think i am liking your solution the best. do i need to get an add on to use iCal to schedule my apps, or is it part of the program? also, that iBeeZz looks pretty good. you’ve had good experience with it?

thanks!

No, iCal 1.5.2 is ready to run scripts out of the box. To schedule a script:

  1. Create a repeating event and set the “From” time to the time that you want the script to run.
  2. Choose “Open file” from the alarm pop-up and select the script file.

That’s it. iCal does not need to be running for the script to be triggered (it’s handled by a background app). iBeeZz is great and I’ve had a problem only in the last couple of releases. The developer is very responsive and the bug has likely been fixed in the version that was released within the last couple of days. I have no problem with recommending it to others.

– Rob

Here is a current list (as of 1/29/04) of applications for Mac OS X that can schedule the launching of scripts:
· cron ([url=http://www.macdevcenter.com/pub/a/mac/2001/12/14/terminal_one.html]http://www.macdevcenter.com/pub/a/mac/2001/12/14/terminal_one.html[/url])
· Cronathon ([url=http://www.nonamescriptware.com/forums/index.php?&act=Downloads&CODE=02&id=9]http://www.nonamescriptware.com/forums/index.php?&act=Downloads&CODE=02&id=9[/url])
· Cronnix ([url=http://www.koch-schmidt.de/cronnix/]http://www.koch-schmidt.de/cronnix/[/url])
· CronoTask ([url=http://www.tensionsoftware.com/cronotask/]http://www.tensionsoftware.com/cronotask/[/url])
· iBeeZz ([url=http://www.ibeezz.com/]http://www.ibeezz.com/[/url])
· iCal ([url=http://www.apple.com/ical/]http://www.apple.com/ical/[/url])
· iDo Script Scheduler ([url=http://www.sophisticated.com/products/ido/ido_ss.html]http://www.sophisticated.com/products/ido/ido_ss.html[/url])
· MacAT ([url=http://gimr.garvan.unsw.edu.au/gerham/macsos/macat/]http://gimr.garvan.unsw.edu.au/gerham/macsos/macat/[/url])
· piTime ([url=http://www.pidog.com/piTime/]http://www.pidog.com/piTime/[/url])
· QuicKeys ([url=http://www.quickeys.com/]http://www.quickeys.com/[/url])
· Script Timer ([url=http://www.versiontracker.com/dyn/moreinfo/macosx/11290]http://www.versiontracker.com/dyn/moreinfo/macosx/11290[/url])
· tempus ([url=http://osx.apesseekingknowledge.net/tempus.html]http://osx.apesseekingknowledge.net/tempus.html[/url])
· xControl ([url=http://akwairc.online.fr/xcontrol.html]http://akwairc.online.fr/xcontrol.html[/url])
Jon