数字|电子邮件| AppleScript的

时间:2015-05-12 20:45:05

标签: email applescript iwork

我想创建一个数字电子表格。在该电子表格中,我想要COL A电子邮件Col B城市名称COL C其他城市名称等。我将手动输入该数据。

接下来我要做的是让数字电子表格中逐行浏览,并向列中的每个人发送电子邮件。我想使用电子邮件主题或正文中的其他变量。

任何帮助将不胜感激!我是最好的程序员。我知道一点点python但是对于AppleScript来说是新手。

伪代码(可能?)

tell numbers to open spreadsheet
repeat for each line of spreadsheet
tell mail to create email
for address COL A
for subject "Hello (COL B) I need the following Information (COL C)
for email Body "Blah Blah Blah (Col D) blah blah."
send email 
end repeat

电子邮件功能

on email(a, b, c, d)
    set recipientName to a
    set recipientAddress to b
    set theSubject to c & " --> " & d & "Shipment"
    set theContent to a & ", if you would like assistance with your shipment moving from " & c & " to " & d & " , or any other shipment you may have, please let me know. We have drivers available in your Area of Operations ready for pick up."

    tell application "Mail"

        ##Create the message
        set theMessage to make new outgoing message with properties {subject:theSubject, content:theContent, visible:true}

        ##Set a recipient
        tell theMessage
            make new to recipient with properties {name:recipientName, address:recipientAddress}

        ##Send the Message
            send

        end tell
    end tell
    end email

    my email(COL A, COL B, COL C, COL D)

1 个答案:

答案 0 :(得分:0)

这就是我一起砍的行为!我是新手,所以要温柔。非常感谢改进和批评!

>>> import numpy as np
>>> ans_list = np.array([1,2,3,4,5])
>>> ans_ind = 3
>>> ans_list[ans_list != ans_ind]
array([1, 2, 4, 5])