0
tell application "System Events"
set window_check to false
repeat until (window_check)
    set frontApp to name of first application process whose frontmost is true
    if frontApp is "Microsoft Outlook" then
        tell process "Microsoft Outlook"
            if class of front window is draft window then 
            --syntax error: expected "then", etc. but found class name
                display dialog "draft"                  
                set window_check to true
            end if
        end tell
    end if
end repeat
end tell

当我保存脚本时,它会弹出一个错误“语法错误:预期的“then”等,但找到了类名”(请参阅​​错误位置的注释)

我的脚本有什么问题?

4

2 回答 2

1

您必须告诉 Outlook,而不是系统事件...

tell application "Microsoft Outlook" to return class of front window is draft window
于 2013-05-13T11:21:12.570 回答
0

前提是,我没有安装 Microsoft Outlook,目前,我设法通过在“草稿”之后删除“窗口”来编译它。

 if class of front window is draft then

看看 Outlook 的 AppleScript 字典,看看它是如何识别类的:“草稿”似乎已经是一个类标识符。

于 2013-05-13T08:30:07.817 回答