Sample Header Ad - 728x90

Applescript folder action to email file

2 votes
1 answer
89 views
What's wrong with this script? I keep getting a syntax error on the word message on line 9. property defaultEmailApplication : "Microsoft Outlook" -- change this to the name of your default email application on adding folder items to this_folder after receiving added_items repeat with added_item in added_items tell application "Finder" set file_extension to name extension of added_item if file_extension is "eml" then set file_path to quoted form of POSIX path of added_item tell application defaultEmailApplication activate set new_message to make new message with properties {visible:true} set message_content to read file file_path as «class utf8» tell new_message set message_subject to subject of (first message of (import message from message_content)) set message_body to content of (first message of (import message from message_content)) set message_attachments to every mail attachment of (first message of (import message from message_content)) set subject to message_subject set content to message_body repeat with attachment_file in message_attachments make new attachment with properties {file name:attachment_file} end repeat end tell end tell end if end tell end repeat end adding folder items to
Asked by Ryan (39 rep)
May 6, 2023, 01:40 PM
Last activity: May 29, 2025, 05:03 PM