1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| set Fichier to ((path to desktop folder) as string) & "Copie_Ecran.png"
do shell script "screencapture -tjpg " & quoted form of POSIX path of Fichier-- copie l'écran dans le fichier (jpg pour meilleure compression)
set Mon_Sujet to "copie d'écran"
set Mon_Content to "Voici en pj la copie d'écran"
set Mon_Destinataire to "toto@gmail.com" -- met ici ton adresse email
tell application "Mail"
activate
set newMessage to make new outgoing message with properties {visible:true, subject:Mon_Sujet, content:Mon_Content}
tell newMessage
make new to recipient at end of to recipients with properties {name:"", address:Mon_Destinataire}
make new attachment with properties {file name:(Fichier as alias)} at after the last paragraph
delay 2 -- attendre 2 secondes que le fichier soit copié en pj par mail
send
end tell
end tell
tell application "Finder" to delete (Fichier as alias) -- supprimer le fichier
delay 1 -- Attente de la fin de l'envoi du mail (selon taille écran !)
say "le mail est envoyé" |
Partager