Answers:
使用内容创建AppleScript文件
on opening folder theAttachedFolder
do shell script "echo 'The folder \"folder name\" has been opened' | mail -s 'folder opened' 'name@sld.tld'"
end opening folder
替换文件夹名称中的\“文件夹名称\”与真正的文件夹名称,在.scpt文件中输入正确的电子邮件地址,并将其保存到/图书馆/脚本/文件夹\行动\ Scripts中。
然后通过将此脚本附加到受监视文件夹来配置文件夹操作。如果mail ...
在您的环境中不起作用,则必须使用另一个CLI邮件客户端。使用有效的OS X / macOS服务器及其配置和运行的邮件服务器以及相应的用户帐户,它可以直接使用。
更高级版本,只需要插入电子邮件地址:
on opening folder theAttachedFolder
set theFolder to quoted form of POSIX path of theAttachedFolder
set Username to quoted form of short user name of (system info)
do shell script "echo 'The folder " & theFolder & " has been opened by " & Username & "!' | mail -s 'Monitored folder opened' 'name@sld.tld'"
end opening folder