Apple Script Mail >Filename

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Apple Script Mail >Filename Thu Aug 23, 2018 6:38 am • by volmer
Hello I am trying to write an apple script in which the filename is sent in a mail. (Text) Where do I have to insert these scripts into my existing one? Thanks for helping Daniel



et subject_ to "Receipt (Automated)"
set the_content to "mail Text"
set email_from to "ADRESSE"
set email_to to "ADRESSE"
tell application "Mail"
set newMessage to make new outgoing message with properties {visible:true, subject:subject_, content:the_content}
tell newMessage

set visible to false
set sender to email_from
make new to recipient at end of to recipients with properties {address:email_to}
try
make new attachment with properties {file name:theFilename} at after the last paragraph
on error errmess -- oops
log errmess -- log the error
end try
delay 1
(* change save to send to send*)
send --<<<<---------------- change save to send to send or send to save to save to drafts
(* change save to send to send*)
end tell
end tell
volmer
 
Posts: 1
Joined: Thu Aug 23, 2018 6:26 am

Re: Apple Script Mail >Filename Thu Aug 23, 2018 11:51 am • by Mr_Noodle
You need to use the "Run applescript" action. Search the forums as I believe similar scripts have been posted.
Mr_Noodle
Site Admin
 
Posts: 11251
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support

cron