Im trying to create an Automator folder action that sends an email with an attached file.
In my folder the files will be generated with the email as name:
Example: name@company.com.jpg, othername@othercompany.com.jpg and so on.
What I need is an action that copies the filename, remove the extension (.jpg), create an email and put the filename/email into the "To" and then sends the email.
I all ready have a working version where the file is attached to the e-mail and the content of the e-mail is filled out. But I can't find a solution to copy the file name and specify it to the "To" address.
Hope that someone out there can help me 🙂
Best Answer
I've tried with Automator without succeeding looping through dropped files.
Here's a folder action script that does what you want, and how to attach it to a folder :
1. Open AppleScript Editor
2. Paste the following script into a new document
3. Save it in your ~/Library/Scripts/Folder Action Scripts Folder
Menu File > Save
Go to the right folder : press cmd+G and paste:
~/Library/Scripts/Folder Action Scripts
and click Go
Save as : Image - Email using name as address.scpt (for example)
Format : Script
4. Create a new folder that will be watched for added items
5. Associate the script to the folder
In the Finder, right click on your folder, then select Services > Folder Actions Setup Select the new created Image - Email using name as address.scpt script
You're done, drop a file whose name is an address, mail will be sent.