Hi, periodically I have to send my accountant all a whole bunch of documents. Now, she is using an online service that requires me to send 1 document / attachment per e-mail. Say there are 25 docs, I have to manually right-click 25 times each consecutieve doc and select Send by email, enter the addrss in Mail and click Send.
Highly inefficiënt.
Is there a way to have this automated fo all files in a folder? I searched for a script buy can’t find what I need. My knowledge of any scripting language is close to nil…
tell application id "DNtp"
repeat with theGroup in (get selection)
repeat with theRecord in (children of theGroup)
set theName to name of theRecord
set thePath to path of theRecord
my MailRecord(theName, thePath)
end repeat
end repeat
end tell
on MailRecord(theName, thePath)
tell application "Mail"
set theFrom to ""
set theTos to {""}
set theCcs to {}
set theBccs to {}
set theSubject to "" & theName
set theContent to ""
set theMessage to make new outgoing message with properties {sender:theFrom, subject:theSubject, content:theContent, visible:false}
tell theMessage
repeat with theTo in theTos
make new recipient at end of to recipients with properties {address:theTo}
end repeat
repeat with theCc in theCcs
make new cc recipient at end of cc recipients with properties {address:theCc}
end repeat
repeat with theBcc in theBccs
make new bcc recipient at end of bcc recipients with properties {address:theBcc}
end repeat
make new attachment with properties {file name:thePath} at after last paragraph
delay 1
send
end tell
end tell
end MailRecord
Thnx DTLow. I’ve created a script, put it in a newly created folder ~/Users/hj/Library/Application Scripts/com.devon-technologies.think3/Menu/Mail
I run it, and then nothing happens. If I run it from Script editor, having 3 docs selected in a DevonThink-group, the replies in ScrEditor are: tellapplication “DEVONthink 3” get selection
→ {contentid 147696 ofdatabaseid 5, contentid 148062 ofdatabaseid 5, contentid 147992 ofdatabaseid 5} counteverychildofcontentid 147696 ofdatabaseid 5
→ 0 counteverychildofcontentid 148062 ofdatabaseid 5
→ 0 counteverychildofcontentid 147992 ofdatabaseid 5
→ 0 end tell
The script then stops; no mails are created nor send.