Benches macOS

3

Download jpeg image to folder with AppleS…

apple Verified

Imported from the Apple Support Forums via the Wayback Machine 🔗

I would like to make an applescript that downloads a jpeg image to a specified folder. The page loads with only the image (
http://www.site.com/image.jpeg). At that point I will just setup folder watching and whenever a file hits the folder it prints (I plan on using an Automator plug-in for this). I know I can do all this with automator but I would like to use applescript inside FileMaker so that I can pass the ID number of each unique product and get the specified image. Also, is there anyway to convert an Automator action to applescipt?

Thanks for help steering me in the right direction.

Drew

3 replies

Sign in or join Beachball Help to reply.

  1. 0

    Camelot

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    I would like to make an applescript that downloads a jpeg image to a specified folder

    OK:

    tell application "URL Access Scripting"

    download "http://www.site.com/image.jpeg" to file "HD:path:to:save:the.jpeg"

    end tell

  2. 0

    dev_sleidy

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Or ...

    set {tUrl, dFolder} to {"http://www.dilbert.com/comics/dilbert/archive/images/dilbert2008041261963.jpg ", "~/Desktop/Dilbert/"}

    set {oAStid, AppleScript's text item delimiters} to {AppleScript's text item delimiters, "/"}

    set fName to (last text item of tUrl) as string

    set AppleScript's text item delimiters to oAStid

    do shell script ("mkdir -p " & dFolder & "; curl -A/--user-agent " & tUrl & " >> " & (dFolder & fName))

  3. 0

    Andrew Sanderson

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Thank you so much for your help!!! It work and I am all set! Hopefully this will help someone else out as well!