Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save youandhubris/a5b3dfe6cfaff54db7d61f0dd0ed690b to your computer and use it in GitHub Desktop.
Save youandhubris/a5b3dfe6cfaff54db7d61f0dd0ed690b to your computer and use it in GitHub Desktop.
# 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