7

このスクリプトを実行するたびに、このエラーが発生します。システムイベントでエラーが発生しました:「Test123」は通知メッセージを理解していません。

コード:

--more code...
tell application "System Events"
    if some_system_events_property then
         my notify of "Test123" thru "Test"
    end if
end tell
--more code...
to notify of message thru level
    display dialog message with titel level
end notify

交換しようとしました

my notify of "Test123" thru "Test"

次の場合、成功しませんでした。

notify of "Test123" thru "Test" of me
(notify of "Test123" thru "Test") of me
4

2 に答える 2

6

何をしようとしているのか正確にはわかりませんが、関数を呼び出してパラメーターを渡す方法の例を次に示します。

tell application "System Events"
    set m to "message content"
    my notify(m)
end tell
--more code...
on notify(message)
    display dialog (message)
end notify
于 2011-05-05T19:21:20.197 に答える
3

これを試して:

tell application "System Events"
    if some_system_events_property then
        tell me to notify of "Test123" thru "Test"
    end if
end tell

to notify of message thru level
    display dialog message with title level
end notify

また、AppleScriptハンドラーに直接パラメーター構文を使用することは決してなく、位置パラメーター(つまり、notify( message, level ))を優先します。これは、発見したあいまいな構文の問題を回避するためです。

于 2011-05-05T23:21:44.843 に答える