我正在使用拖放将电子邮件从 Mail 拉到共享服务器上的相关工作子文件夹中。然后我使用脚本按创建日期排序(这是我将它们拖过的日期),然后根据容器的名称重命名文件。
但是我想使用脚本从每个 .eml 文件中提取发送日期、发件人和主题,然后使用该信息重命名文件。
之前有一篇文章回答了类似的问题,但我不清楚(因为我是脚本新手)如何将它放入我的脚本中。它可以在:“AppleScript - 获取 .eml 文件的信息”中找到
答案是:
set fromField to text 7 thru -1 of (do shell script "cat /test.eml | grep From:")
set dateField to text 7 thru -1 of (do shell script "cat test.eml | grep Date:")
set toField to text 5 thru -1 of (do shell script "cat /test.eml | grep To:")
set subjectField to text 10 thru -1 of (do shell script "cat /test.eml | grep Subject:")
我想我需要有人编写实际的 shell 脚本并告诉我放置它的位置。