Newbie : how to download an image ?

I would like to run a script, say every day, to download a picture (.jpg), for example some "picture of the day" in a given folder.
I'ld anticipate the handler to look like :
+on downloadImage(imgURL,targetFolder,targetFile)+
where imgURL is the URL of the .jpg picture, targetFolder the folder where to save the picture and targetrFile the name of the saved picture.
I'm turning crazy with my miserable knowledge of Applescript. Could anybody help mein writing this handler ? Thanks

There's a standard command to do this in AppleScript:
on downloadImage(imgURL, targetFolder, targetFile)
  tell application "URL Access Scripting"
    download imgURL to file ((targetFolder as text) & targetFile)
  end tell
end downloadimage

Similar Messages

  • How to download RAW images from Canon S100 to iPhoto?

    How to download RAW images from Canon S100 to iPhoto?

    You need the Raw compatibility update 3.9:
    http://support.apple.com/kb/DL1473

  • How to download blob image, inline to new browser tab or window

    APEX V4.2.3
    I have an interactive report with a blob download column which is set to inline.  When I click on the "download" link the image appears automatically in same window as the APEX application.  How do I download the image into a new browser tab?  I need to squeeze 'target="_blank" ' somewhere but I don't know where as the link structure is hidden.
    Here is the code for my download column in the Interactive Report.
    select
    decode(nvl(dbms_lob.getlength(BLOB_CONTENT),0),0,null,
    '<img style="border: 4px solid #CCC; -moz-border-radius: 4px; -webkit-border-radius: 4px;" '||
    'src="'||
    apex_util.get_blob_file_src('P98_BLOB_CONTENT',image_id)||
    '" height="100" width="100" alt="'||FILENAME||'" title="'||FILENAME||'" />')
    as detail_img,
    from "#OWNER#"."TIS_ATTACHMENTS"
    thanks in advance
    PaulP

    I would suggest
    SELECT ID, NAME,CASE WHEN NVL(dbms_lob.getlength(document),0) = 0
      THEN NULL
      ELSE CASE WHEN attach_mimetype like 'image%'
      THEN '<img src="'||apex_util.get_blob_file_src('P4_DOCUMENT',id)||'" />'
      ELSE
      '<a  target="_blank" href="'||apex_util.get_blob_file_src('P4_DOCUMENT',id)||'">Download</a>'
      end
      END new_img
      FROM TEST_WITH_BLOB

  • How to download an image from java server

    Hi,
       I have created a program which allows me to upload images to Java Server thru Multipart.
    How can i receive an image from server and download it to iPhone app.Is there any way apart from NSURL i can download the image.
    Base64 Encoding & Decoding  seems to be not working.
    Thanks in advance,
      Haritha

    Hi,
       I have created a program which allows me to upload images to Java Server thru Multipart.
    How can i receive an image from server and download it to iPhone app.Is there any way apart from NSURL i can download the image.
    Base64 Encoding & Decoding  seems to be not working.
    Thanks in advance,
      Haritha

  • How to download an image from SAP to my PC?

    Hello SAPients.
    I know that I can upload an image to SAP using transaction SE78, but now I need the inverse process, I mean, download an image from SAP to my PC. How can I do this?
    Thanks in advance for your help.

    The following program codes allow you to download SAP images stored in SE78 and the traditional SO10:
    *& Report  Z_DOWNLOAD_BDS_GRAPHICS
    *& Download image stored in document server
    *& Published at ****************
    REPORT  z_download_bds_graphics                 .
    * Variable declaration
    DATA: v_graphic_size TYPE i,
          v_graphic_xstr TYPE xstring,
          v_graphic_conv TYPE i,
          v_graphic_offs TYPE i,
          v_file         TYPE string.
    * Table declaration
    DATA: BEGIN OF i_graphic_table OCCURS 0,
            line(255) TYPE x,
          END OF i_graphic_table.
    DATA: lt_tline type table of tline with header line.
    data: l_thead type thead.
    * Structure declaration
    DATA: st_stxbitmaps       TYPE stxbitmaps.
    * Selection screen
    PARAMETERS: P_SO10 RADIOBUTTON GROUP RB1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
    PARAMETERS: p_TDID     LIKE THEAD-TDID DEFAULT 'ADRS',
                p_TDNAME   LIKE THEAD-TDNAME,
                p_TDOBJ    LIKE THEAD-TDOBJECT DEFAULT 'TEXT',
                p_TDSPRA   LIKE THEAD-TDSPRAS DEFAULT 'EN'.
    SELECTION-SCREEN END OF BLOCK b2.
    PARAMETERS: p_se78 RADIOBUTTON GROUP RB1.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS: p_object LIKE st_stxbitmaps-tdobject DEFAULT 'GRAPHICS'
                                  MODIF ID abc ,
                p_name   LIKE st_stxbitmaps-tdname,
                p_id     LIKE st_stxbitmaps-tdid DEFAULT 'BMAP'
                                  MODIF ID abc ,
                p_type   LIKE st_stxbitmaps-tdbtype.
    SELECTION-SCREEN END OF BLOCK b1.
    PARAMETERS: p_dir    TYPE localfile DEFAULT 'D:\GIS'.
    * At Selection-screen output event
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF screen-group1 = 'ABC' .
          screen-input = '0'.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
    * At Selection-screen on value-request event
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_dir.
      DATA: l_folder TYPE string.
      CALL METHOD cl_gui_frontend_services=>directory_browse
        EXPORTING
          window_title         = 'Select Folder'
          initial_folder       = 'C:\'
        CHANGING
          selected_folder      = l_folder
        EXCEPTIONS
          cntl_error           = 1
          error_no_gui         = 2
          not_supported_by_gui = 3
          OTHERS               = 4.
      IF sy-subrc = 0.
        p_dir = l_folder.
      ENDIF.
    * Start-of-selection event
    START-OF-SELECTION.
      IF p_se78 = 'X'.
        st_stxbitmaps-tdobject = p_object.
        st_stxbitmaps-tdname = p_name.
        st_stxbitmaps-tdid = p_id.
        st_stxbitmaps-tdbtype = p_type.
    *   Get the bmp image from BDS in hex string format
        CALL METHOD cl_ssf_xsf_utilities=>get_bds_graphic_as_bmp
          EXPORTING
            p_object       = st_stxbitmaps-tdobject
            p_name         = st_stxbitmaps-tdname
            p_id           = st_stxbitmaps-tdid
            p_btype        = st_stxbitmaps-tdbtype
          RECEIVING
            p_bmp          = v_graphic_xstr
          EXCEPTIONS
            not_found      = 1
            internal_error = 2
            OTHERS         = 3.
        IF sy-subrc = 0.
    *     Find the length of hex string
          v_graphic_size = xstrlen( v_graphic_xstr ).
          CHECK v_graphic_size > 0.
          v_graphic_conv = v_graphic_size.
          v_graphic_offs = 0.
    *     Populate internal table from this hex string
          WHILE v_graphic_conv > 255.
            i_graphic_table-line = v_graphic_xstr+v_graphic_offs(255).
            APPEND i_graphic_table.
            v_graphic_offs = v_graphic_offs + 255.
            v_graphic_conv = v_graphic_conv - 255.
          ENDWHILE.
         i_graphic_table-line = v_graphic_xstr+v_graphic_offs(v_graphic_conv).
          APPEND i_graphic_table.
    *     Prepare file name and file path
          CONCATENATE p_dir '\' p_name '.BMP' INTO v_file.
    *     Download image
          CALL FUNCTION 'GUI_DOWNLOAD'
            EXPORTING
              bin_filesize            = v_graphic_size
              filename                = v_file
              filetype                = 'BIN'
            TABLES
              data_tab                = i_graphic_table
            EXCEPTIONS
              file_write_error        = 1
              no_batch                = 2
              gui_refuse_filetransfer = 3
              invalid_type            = 4
              no_authority            = 5
              unknown_error           = 6
              header_not_allowed      = 7
              separator_not_allowed   = 8
              filesize_not_allowed    = 9
              header_too_long         = 10
              dp_error_create         = 11
              dp_error_send           = 12
              dp_error_write          = 13
              unknown_dp_error        = 14
              access_denied           = 15
              dp_out_of_memory        = 16
              disk_full               = 17
              dp_timeout              = 18
              file_not_found          = 19
              dataprovider_exception  = 20
              control_flush_error     = 21
              OTHERS                  = 22.
          IF sy-subrc = 0.
            WRITE: 'File downloaded successfully'(003), v_file.
          ELSE.
            WRITE: 'Error during file download'(004).
          ENDIF.
        ELSE.
          CASE sy-subrc.
            WHEN 1.
              WRITE: 'Image not found'(005).
            WHEN OTHERS.
              WRITE: 'Error in Image retrieval'(006).
          ENDCASE.
        ENDIF.
      ENDIF. "IF P_SE78 = 'X'.
      IF P_SO10 = 'X'.
        CALL FUNCTION 'READ_TEXT'
          EXPORTING
    *       CLIENT                        = SY-MANDT
            ID                            = p_TDID
            LANGUAGE                      = p_TDSPRA
            NAME                          = p_TDNAME
            OBJECT                        = p_TDOBJ
    *       ARCHIVE_HANDLE                = 0
    *       LOCAL_CAT                     = ' '
          IMPORTING
            HEADER                        = l_thead
          TABLES
            LINES                         = lt_tline
          EXCEPTIONS
             ID                            = 1
             LANGUAGE                      = 2
             NAME                          = 3
             NOT_FOUND                     = 4
             OBJECT                        = 5
             REFERENCE_CHECK               = 6
             WRONG_ACCESS_TO_ARCHIVE       = 7
             OTHERS                        = 8
        IF SY-SUBRC <> 0.
              WRITE: 'Image not found'(005).
        ENDIF.
    CALL FUNCTION 'SAPSCRIPT_CONVERT_BITMAP'
      EXPORTING
        ITF_HEADER                     = l_thead
        OLD_FORMAT                     = 'ITF'
        NEW_FORMAT                     = 'BMP'
        BITMAP_FILE_BYTECOUNT_IN       = 0
        ITF_BITMAP_TYPE_IN             = '*'
    IMPORTING
       BITMAP_FILE_BYTECOUNT          = v_graphic_size
    *   ITF_BITMAP_TYPE_OUT            =
      TABLES
        ITF_LINES                      = lt_tline
        BITMAP_FILE                    = i_graphic_table
    *   BDS_BITMAP_FILE                =
      EXCEPTIONS
        NO_BITMAP_FILE                 = 1
        FORMAT_NOT_SUPPORTED           = 2
        BITMAP_FILE_NOT_TYPE_X         = 3
        NO_BMP_FILE                    = 4
        BMPERR_INVALID_FORMAT          = 5
        BMPERR_NO_COLORTABLE           = 6
        BMPERR_UNSUP_COMPRESSION       = 7
        BMPERR_CORRUPT_RLE_DATA        = 8
        BMPERR_EOF                     = 9
        BDSERR_INVALID_FORMAT          = 10
        BDSERR_EOF                     = 11
        OTHERS                         = 12
    IF SY-SUBRC <> 0.
              WRITE: 'Error in Image Format'(006).
    ENDIF.
        if sy-subrc = 0.
          CONCATENATE p_dir '\' p_TDNAME '.BMP' INTO v_file.
    *     Download image
          CALL FUNCTION 'GUI_DOWNLOAD'
            EXPORTING
              bin_filesize            = v_graphic_size
              filename                = v_file
              filetype                = 'BIN'
            TABLES
              data_tab                = i_graphic_table
            EXCEPTIONS
              file_write_error        = 1
              no_batch                = 2
              gui_refuse_filetransfer = 3
              invalid_type            = 4
              no_authority            = 5
              unknown_error           = 6
              header_not_allowed      = 7
              separator_not_allowed   = 8
              filesize_not_allowed    = 9
              header_too_long         = 10
              dp_error_create         = 11
              dp_error_send           = 12
              dp_error_write          = 13
              unknown_dp_error        = 14
              access_denied           = 15
              dp_out_of_memory        = 16
              disk_full               = 17
              dp_timeout              = 18
              file_not_found          = 19
              dataprovider_exception  = 20
              control_flush_error     = 21
              OTHERS                  = 22.
          IF sy-subrc = 0.
            WRITE: 'File downloaded successfully'(003), v_file.
          ELSE.
            WRITE: 'Error during file download'(004).
          ENDIF.
        endif.
      ENDIF.

  • How to download install images for previous CS purchase

    I have tried to find the answer and am unable yo contact support so your payience and help is appreciated
    I can no longer afford/justify the Creative cloud as it is a "just to keep my hand in" in my retirement so want to reinstall CS5.5 which the Adobe site shows I have purchased. The last physical CD purchase was CS4  and I no longer have a CD drive so need to download the images to re-install.
    Your help would be a wonderful thing
    Greg

    http://prodesigntools.com/tag/ddl
    Mylenium

  • How to download email images

    When I download my (g)mail none of the images show, how do i get them?
    Solved!
    Go to Solution.

    Standard privacy setting(prevents image tracking) click icon of mountains to the right of rubbish bin to show images.

  • How to download an image/file with WebClient API (to show progress visualy)?

    Hi. Can you show me C# code to do the above query. Thank you in advance.

    Hi
    Clint William Theron,
    You can try this code .
    string localFilename = @"c:\localpath\tofile.jpg";
    using(WebClient client = new WebClient())
    client.DownloadFile("http://www.imagesABC.com/myimage.jpg", localFilename);
    For more reference find following link:-
    http://stackoverflow.com/questions/3615800/download-image-from-the-site-in-net-c
    http://stackoverflow.com/questions/21572276/downloading-and-saving-a-file-async-in-windows-phone-8
    Don't
    forget to mark the right answer and vote up if helps you.

  • How to download screen image of AG86100A thru GPIB via Labview

    Hi all,
    Would you please help me to download the screen image of AG86100A DCA thru GPIB via Labview ? Thank you very much for your help.

    If you are looking to grab the screen dump from the instrument (output to an HPGL device like the 7470A plotter) then you could use Printcapture, IntuiLink,  Plottergeist  or features of the GPIB toolkit.
    These will capture a screenshot, not transfer the data that created the image. The alternative is to download the data using the drivers mentioned and then create your own chart/graph using LabVIEW.  You could save the image to a file using the indicator's methods and properties from the block diagram.
    Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
    If you don't hate time zones, you're not a real programmer.
    "You are what you don't automate"
    Inplaceness is synonymous with insidiousness

  • I cannot move photos from iphone to MacBook.  I get an error message that says: Error downloading image. iPhoto cannot import your images because there was a problem downloading an image. How can I fix/remedy this?

    I am receiving an error message every time I plug my iPhone 4S into my MacBook: Error downloading image. iPhoto cannot import your images because there was problem downloading an image.  How can I fix/remedy this?

    try Image Capture - in your applications folder
    LN

  • How do I change downloaded raw images to jpeg?

    NIKON D60 CAMERA.  Shoot Raw images at times. These get downloaded to MacBook Pro.  Could someone please instruct me how to change Raw images in the MacBook Pro to JPeg? 
    Also, is raw  the reason I cannot burn images to a disc?
    And, does Nikon NX2 Photoahop 10 interface well with my Apple computer?
    Thanks

    lindafromwestdesmoines wrote:
    NIKON D60 CAMERA.  Shoot Raw images at times. These get downloaded to MacBook Pro.  Could someone please instruct me how to change Raw images in the MacBook Pro to JPeg? 
    iPhoto, Preview, Aperture and many others will convert RAW images.
    Also, is raw  the reason I cannot burn images to a disc?
    No, the format of the file shouldn't  be interfering with burning them to a CD. How are you creating the CD?
    And, does Nikon NX2 Photoahop 10 interface well with my Apple computer?
    Sorry can;t answer this one.

  • How to download purchased installation image of OS X Mountain Lion

    How to download purchased installation image of OS X Mountain Lion for clean boot installation.

    When, and if, you can get Mountain Lioin to download, it will automatically try to install itself. If you want to create a bootable installation disk (disc), quit the installer. You'll have a file in your Applications folder a file named "Install OS X Mountain Lion.app". Get yourself either a 8GB+ USB flash drive or use a dual-layer DVD and use Lion DiskMaker to create a bootable installation flash drive or DVD (the USB flash drive will be faster).
    Don't know why you're having trouble with the download, though....
    Clinton

  • How do I download raw images into photoshop elements 11.

    I am having difficulty downloading my raw images to photoshop elements 11.  Files are currently on a thumb drive, but I don't know how to download to elements.  I have the thumb drive plugged in --- not sure where to go from here. I have verified that I have the plug in - version 7.1.0.354.
    Any ideas?

    You can either drag them in Organizer workspace or import the folder. Or you can also use Adobe Photo Downloader. There are many options listed here http://helpx.adobe.com/photoshop-elements/getting-started/import-camera-or-card-reader.htm l
    Thanks,
    Garry

  • I am unable to download all photos to computer.  At a certain photo I get the following message:  IPhoto cannot import your photos because there was a problem downloading an image.  How can I go around this  image

    I am unable to import all photos to IPhoto on computer.  At a certain photo the following message appears:  IPhoto cannot import your photos
    because there was a problem downloading an image.  How can I circumvent this particular image and import all other photos?

    I'm having the same issue.  i have imported everything but the offending photo from my iPhone.  problem is, with over 5000 pics, i have no idea how to find THAT ONE pic that won't import (bc I just get a greyed out pic image - with no data in iPhoto)
    any idea how to get "date taken" info of THAT ONE pic out of iPhoto (or any metadata) so I don't have to search 3 years of pictures?
    and I do apologize for hijacking.

  • I have taken pictures of items that are linked to a database that I am building.  How can I bypass importing into iPhoto and simply downloading the images as "files" not "photos" so I can access them with my database?  thanx.

    I have taken pictures with both my Sony camera and my iPhone of items that are linked to a database that I am building, as well as my website.  How can I bypass importing the images into iPhoto and simply downloading the images as "files" not "photos" so I can access them with my database?  thanx.

    If your Sony has a removable memory card you can use a card reader to copy the image files from to a folder on your Desktop and then move them anywhere you'd like.
    Since the iPhone doesn't have a removable memory card you can try using Image Capture to see if you can manually upload the files to a folder on the Desktop. 
    If you have to import the photos, which are image files, into iPhoto you can then export them out of iPhoto to the Desktop and go from there to your database.  Just because they are in iPhoto doesn't prevent you from using them elsewhere.
    OT

Maybe you are looking for

  • I just turned on time machine, firewall, firevault after a year and a half

    I've had my mac for over a year now, i got it in february 2010, and i just activated time machine, it said it will take 'about a day' now it says 14 hours [the time changes].... the size of it is 30.86 GB, which i understand is a lot, i wanted to kno

  • Excise details in GRN

    Hi Experts, With help of Purchase order number & the GR number how can i extract the excise invoice Document. Please tell me the Table for this. i am preparing PO to Payment report Regards Aditya Sharma

  • Will Mountain Lion replace OR enchance Lion?

    I have OS X and never bought LION as I dont know that much about this stuff. Do I buy OS X LIon now or wit for OS X Mountain Lion? Dont hate me because I'm a LUddite..

  • SB X-Fi Surround 5.1 Pro problem

    Hi download link dont work any more, please reupload.

  • Data download for planning

    I want to production planning in other SYSTEM other than SAP R/3 , for that to load all relevant data from R/3 to other system. 1. Independent demand  ( item , ship-to , qty, so no. so line no. cust no. cust name due date  ) : please give table name