I would like to get the images attached to emails in an outlook folder, convert them to PDF's and save them to a folder. The code i have so far gets the attachments and saves them to a folder but i do not know what to add to convert them to PDF's.

set saveToFolder to POSIX path of "/Users/userXXX/Documents/DestinationFolder/"

tell application "Microsoft Outlook"
    set srcFolder to folder "ImageFolder" of default account
    set selectedMessages to messages of srcFolder
    repeat with msg in selectedMessages
        set msgsender to the sender of msg
        set senderaddress to the address of msgsender
        set attFiles to attachments of msg
        repeat with f in attFiles
            set attName to (get the name of f)
            log attName
            set saveAsName to saveToFolder & attName
            log saveAsName
            save f in POSIX file saveAsName
        end repeat
    end repeat
end tell

0 Answers