你要找的是一个AppleScript
open handler
. 下面是一个简单的示例,通过为每个文件打开一个新的传出电子邮件来处理多个文件。可能会有很多变化:
on open what
tell application "Mail"
repeat with f in what
set theAttachment to f
set theMessage to make new outgoing message with properties {visible:true, subject:"My Subject", content:"My Body"}
tell content of theMessage
make new attachment with properties {file name:theAttachment} at after last paragraph
end tell
tell theMessage
make new to recipient at end of to recipients with properties {name:"Some One", address:"someone@somewhere"}
end tell
end repeat
end tell
end open
还有很多细节
handlers
在马特·纽伯格的书中
AppleScript:权威指南
.