tell application "Finder"
activate
set the_selection to get selection
repeat with an_item in the_selection
set the_file to an_item as string
set the_name to name of file the_file
set the_file_name to characters 1 thru -5 of the_name
--set the_file_name2 to the_file_name & ".3g2"
set name_extension to name extension of item the_file
if name_extension contains "jpg" then
-- make an outgoing email, add attachment
tell application "Mail"
activate
set MyEmail to make new outgoing message
set MessageFont to message font
set MessageFontSize to message font size
set theSubject to "Pic from Dad"
set theContent to "I hope you like this pic" & return & return
tell MyEmail
make new
recipient at
end of to recipients with properties
{address:"email@hidden"} set visible to true
set content to theContent
set subject to theSubject
set theAttachment to (an_item as alias)
tell content to make new attachment with properties {file name:theAttachment} at after last paragraph
end tell
delay 1
-- send MyEmail
end tell
end if
end repeat
end tell