Last active
April 1, 2018 14:33
-
-
Save youandhubris/a5b3dfe6cfaff54db7d61f0dd0ed690b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Mail Send With Attachment On Adding Folder Items | |
# File > Export | |
# File format: Script / Script Bundle | |
# Put a copy of the script in /Library/Scripts/Folder Action Scripts | |
# or ~/Library/Scripts/Folder Action Scripts | |
# Use the 'Folder Actions Setupp application, located in /Applications/AppleScript, to: | |
# Enable folder actions for your image folder. | |
# Add a script to that folder, choosing the script you created. | |
on adding folder items to this_folder after receiving addedItems | |
repeat with eachItem in addedItems | |
set mailFrom to "" | |
set mailTo to "" | |
set mailToAddress to "" | |
set messageSubject to "" | |
set messageContent to "" | |
tell application "Mail" | |
set newmessage to make new outgoing message with properties {subject:messageSubject, content:messageContent & return & return} | |
tell newmessage | |
set visible to true | |
set sender to mailFrom | |
make new to recipient with properties {name:mailto, address:mailToAddress} | |
make new attachment with properties {file name:eachItem} at after the last paragraph | |
end tell | |
send newmessage | |
end tell | |
end repeat | |
end adding folder items to |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment