我是Apple的新手,我在做一些看似非常基本的事情时遇到了很大的麻烦。我正在尝试使用附件以RTF格式保存选定的邮件。这是错误的脚本:
tell application "Mail"
activate
set AllMessages to selection
set myMessage to item 1 of AllMessages
open myMessage
tell application "System Events"
tell process "Mail"
tell menu bar 1
tell menu bar item "File"
tell menu "File"
click menu item "Save As…"
delay 2
keystroke "test"
click checkbox "Include Attachments" -- result: ERROR
end tell
end tell
end tell
end tell
end tell
end tell
答案 0 :(得分:0)
您可以尝试这样的事情:
set the clipboard to POSIX path of (path to desktop as text) & "test"
tell application "Mail"
open first item of (get selection)
activate
end tell
tell application "System Events"
tell process "Mail"
click menu item "Save As…" of menu 1 of menu bar item "File" of menu bar 1
delay 3
perform action "AXPress" of pop up button 1 of group 1 of sheet 1 of window 1
click menu item 1 of menu 1 of pop up button 1 of group 1 of sheet 1 of window 1
if value of checkbox "Include Attachments" of group 1 of sheet 1 of window 1 = 0 then
perform action "AXPress" of checkbox "Include Attachments" of group 1 of sheet 1 of window 1
end if
keystroke "g" using {command down, shift down}
keystroke "v" using {command down}
keystroke return
keystroke return
end tell
end tell