This looks promising for the script part: http://osxdaily.com/2007/05/11/download ... mand-line/ (and AppleScript or Automator is fine if either are more ideal solutions):
- Code: Select all
cd ~/Desktop; curl -O http://remote-server-IP/remote-image-file.jpg
But I am having trouble as a scripting novice to figure out how to have Hazel grab the URL from the text file and use it in a script.
My initial thought was to set up a Contents rule in Hazel and a Contains Match condition and custom tokens to grab the URL at the end of the text document, and pass that along into the script.
I can see how Hazel grabs the file path (using $1) for use in the shell script, but not how I can dynamically insert a URL.
And for clarification, here's what I want to do: keep a text file on Dropbox that I append image URLs to (via Drafts on the iPhone), and then Have Hazel and a script grab those URLs and save the images locally.
Images are the only limitation to my plain-text workflow, and this is my initial attempt to get past that.