Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/email/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Email AppleScript:从列表在邮件应用程序中创建SmartInbox_Email_Applescript - Fatal编程技术网

Email AppleScript:从列表在邮件应用程序中创建SmartInbox

Email AppleScript:从列表在邮件应用程序中创建SmartInbox,email,applescript,Email,Applescript,我只是想知道你是否能帮忙 我已经开始使用applescript在邮件应用程序中创建智能邮箱 智能收件箱的电子邮件列表位于桌面上的myFile.txt中。每行有一封电子邮件 我想在智能收件箱中添加几封电子邮件,并想将其自动化 我尝试了以下脚本 tell application "Mail" activate end tell # GUI Script to initiate Smart Inbox creation tell application "Sy

我只是想知道你是否能帮忙

我已经开始使用applescript在邮件应用程序中创建智能邮箱 智能收件箱的电子邮件列表位于桌面上的myFile.txt中。每行有一封电子邮件

我想在智能收件箱中添加几封电子邮件,并想将其自动化

我尝试了以下脚本

tell application "Mail"
    activate
end tell

# GUI Script to initiate Smart Inbox creation

tell application "System Events"
    tell process "Mail"
        tell menu bar 1
            tell menu bar item "Mailbox"
                tell menu "Mailbox"
                    click menu item "New Smart Mailbox…"
                end tell
            end tell
        end tell
        
        delay 1
        # Set name for the Smart Mailbox
        tell application "System Events" to keystroke ("MyAutomaticSmartMailBox" as text)

        keystroke tab

        # Set path to myFile.txt
        set srcFile to ((path to desktop) as text) & "myFile.txt"
        
        # Read lines from file.
        set lns to paragraphs of (read file srcFile as «class utf8»)
        
        # Loop over lines read and copy each to the clipboard.
        repeat with ln in lns
            set the clipboard to ln
            # Paste the clipboard into Smart inBox dialog
            tell application "System Events" to keystroke (the clipboard as text)
            # to create next line to add email
            click button "NSButtonCell"
        end repeat
        
        
    end tell
end tell
给我一个错误

error "System Events got an error: Can’t make file \"MackintoshHD:Users:one:Desktop:myFile.txt\" of process \"Mail\" into type file." number -1700 from file "MackintoshHD:Users:one:Desktop:myFile.txt" of process "Mail" to file
如果您能帮助解决此错误,我们将不胜感激 还可以在脚本中的下拉列表中从“任何收件人”更改为“发件人” 干杯

将数据设置为的段落(读取文件)` 这个shud读取文件,将其设置为列表 然后用列表中的aData重复 定则 告诉规则“a”在…结尾处使用条件创建新规则

这是我的作品:)

`set theFile to ((path to desktop as text) & "test.txt")