Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Using applescript to copy paste image description

Hi all,


I'm new to playing around with applescript for anything more than VERY basic repetitive tasks. What I am trying to do is create a script to:

place a single image as an attachment into a new email to a specific address

place the image caption/description from the metadata of the image as the text of the email

and send.



Now, I think I've got everything sorted apart from accessing the image caption, copying, and pasting it. I'm assuming this is possible? Any hints?

Posted on Jul 21, 2013 6:33 PM

Reply
1 reply

Jul 22, 2013 1:53 AM in response to rtsnoz

Got there in the end. 🙂



on openthese

repeat with this_file in these



try

tell application "Image Events"


-- start the Image Events application


launch


-- open the image file

set this_image to openthis_file


-- extract the value for the metadata tag

tell this_image

set the camera_type to the value of metadata tag "description"

end tell



-- purge the open image data


closethis_image



set theContent to camera_type & "

" & "Filed: " & (current date)



set theAttachment to this_file

tell application "Mail"

set theMessage to makenewoutgoing messagewith properties {visible:true, subject:" ", content:theContent}

tell content of theMessage


makenewattachmentwith properties {file name:theAttachment} at after last paragraph

end tell


tell theMessage

make new to recipient at end of to recipients with properties {name:"pic editor", address:"mail@test.com"}

end tell



tell theMessage

send

end tell


end tell

end tell



on error error_message


display dialogerror_messagebuttons {"Cancel"} default button 1

end try

end repeat

end open

Using applescript to copy paste image description

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.